------- Comment #2 from tkoenig at gcc dot gnu dot org 2006-04-02 18:41 ------- The test case also exposes a problem with the way that the result is stored.
Look at this: $ cat matmul.f90 program main implicit none real(8) :: a(2,9), b(9,7), c(2,7) integer :: i, j a = 1.d0 b = 2.d0 c = 1789789.d0 c(:,1:7:2) = matmul(a,b(:,1:7:2)) do i = 1, 7 print *, c(:,i) end do end program main $ gfortran matmul.f90 && ./a.out 18.0000000000000 18.0000000000000 0.00000000000000 0.00000000000000 18.0000000000000 18.0000000000000 0.00000000000000 0.00000000000000 1789807.00000000 1789807.00000000 1789789.00000000 1789789.00000000 1789807.00000000 1789807.00000000 $ ifort matmul.f90 && ./a.out 18.0000000000000 18.0000000000000 1789789.00000000 1789789.00000000 18.0000000000000 18.0000000000000 1789789.00000000 1789789.00000000 18.0000000000000 18.0000000000000 1789789.00000000 1789789.00000000 18.0000000000000 18.0000000000000 -- tkoenig at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26985