Strictly speaking, we should get -0.00000 in all cases. i...@linux-fd1f:~/Fort> cat intrinsic_signed_zero.f90 program main implicit none real, dimension(1) :: a, b real, dimension(1,1) :: aa, bb a(1) = -1.0 b(1) = 0.0 print *,a(1)*b(1) print *,dot_product(a,b) aa(1,1) = -1.0 bb(1,1) = 0.0 print *,matmul(aa,bb) end program main i...@linux-fd1f:~/Fort> gfortran intrinsic_signed_zero.f90 i...@linux-fd1f:~/Fort> ./a.out -0.0000000 0.0000000 0.0000000
-- Summary: dot_product / matmul and signed zeros Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: wrong-code Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tkoenig at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44156