Hi, the code (see below) compiled with gfortran -O2 -Wall -fdefault-integer-8 -ftree-vectorize a.f gives a complete garbage, since compiler changing the order of execution inside the loop. =========================
DIMENSION Nvec(10),iVEC(10) do i=1,10 Nvec(i)=i enddo call Zbase(Nvec,iVec,10) print *,iVec end SUBROUTINE ZBASE(NVEC,IVEC,NCLASS) DIMENSION NVEC(NCLASS),IVEC(NCLASS) IVEC(1) = 1 DO 100 ICLASS = 2,NCLASS IVEC(ICLASS) = IVEC(ICLASS-1)+NVEC(ICLASS-1) 100 CONTINUE RETURN END ========================= Removing -ftree-vectorize, or -fdefault-integer-8, or changing loop to 'Do 100 ICLASS= 2, 10' solves the problem. Best Regards, Valera. -- Summary: vectorization with 64-bit integers Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: valera dot veryazov at teokem dot lu dot se GCC host triplet: Linux_x86-64 CentOS http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34006