As shown by the following code, the complex matrix product is not vectorized, even with the patch in http://gcc.gnu.org/ml/gcc-patches/2009-01/msg01174.html:
program mymatmul implicit none integer, parameter :: kp = 4 integer, parameter :: n = 2000 real(kp), dimension(n,n) :: rr, ri complex(kp), dimension(n,n) :: a,b,c real :: t1, t2 integer :: i, j, k call random_number (rr) call random_number (ri) a = cmplx (rr, ri) call random_number (rr) call random_number (ri) b = cmplx (rr, ri) call cpu_time (t1) c = cmplx (0._kp, 0._kp) do j = 1, n do k = 1, n do i = 1, n c(i,j) = c(i,j) + a(i,k) * b(k,j) end do end do end do call cpu_time (t2) write (*,'(F8.4)') t2-t1 end program mymatmul [ibook-dhum] bug/timing% gfc -m64 -O3 -ffast-math -funroll-loops -fomit-frame-pointer -ftree-vectorizer-verbose=2 mymatmul_v_c4.f90 mymatmul_v_c4.f90:22: note: not vectorized: can't calculate alignment for data ref. mymatmul_v_c4.f90:15: note: not vectorized: complicated access pattern. mymatmul_v_c4.f90:15: note: not vectorized: can't calculate alignment for data ref. mymatmul_v_c4.f90:12: note: not vectorized: complicated access pattern. mymatmul_v_c4.f90:12: note: not vectorized: can't calculate alignment for data ref. mymatmul_v_c4.f90:1: note: vectorized 0 loops in function. The real corresponding code is vectorized. -- Summary: Complex matrix product is not vectorized Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dominiq at lps dot ens dot fr GCC build triplet: i686-apple-darwin9 GCC host triplet: i686-apple-darwin9 GCC target triplet: i686-apple-darwin9 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38968