L.S., This code:
SUBROUTINE S(N, M) DIMENSION A(N, M), B(N, M) READ*,A,B DO J = 1, M DO I = 1, N A(I, J) = A(I, J) + B(I, J) ENDDO ENDDO PRINT*,A END when compiled thusly: $ gfortran -g -S -O3 -ftree-vectorize -ftree-vectorizer-verbose=2 -msse2 vect1.f draws the following "not vectorized" message: vect1.f:5: note: not vectorized: can't determine dependence between (*a_23)[D.951_86] and (*a_23)[D.951_86] vect1.f:5: note: vectorized 0 loops in function. That's pretty silly, of course :-) Source and destination A(I,J) overlap exactly, so vectorization of this loop is certainly possible. The equivalent rank-1 example is vectorized without problems. Exempting this one special case from "can't determine dependence" will mean about 1000 more vectorized loops in HIRLAM. Kind regards, -- Toon Moene - e-mail: [EMAIL PROTECTED] - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/