When I compile the subroutine (pasted at the end of this report) with gfortran -c -ffree-form -O3 bug.f90
The compiler crashes with the output bug.f90: In function 'subbug': bug.f90:1: internal compiler error: in compare_values_warnv, at tree-vrp.c:1031 Please submit a full bug report, with preprocessed source if appropriate. It does not crash with -O2 This is my compiler version gfortran -v Using built-in specs. Target: i386-apple-darwin9.4.0 Configured with: ../gcc-4.4-20080801/configure --enable-languages=fortran Thread model: posix gcc version 4.4.0 20080801 (experimental) (GCC) Finally here is the subroutine "bug.f90" subroutine subbug(data, n1,n2,n3) implicit none integer(kind(1)) :: i,j,k, ngr, n1,n2,n3 real(kind(1.0d0)) :: data((n1+2)*n2*n3) ngr = n1*n2*n3 data(2:ngr+2*n2*n3:2) = -data(2:ngr+2*n2*n3:2) data = RESHAPE((/ & (((data(i+(j-1)*n1+(k-1)*n1*n2),i=1, n1), & data(ngr+1+(j-1)*2+(k-1)*2*n2), & data(ngr+2+(j-1)*2+(k-1)*2*n2),j=1,n2),k=1,n3 ) & /),SHAPE=(/ngr+2*n2*n3/)) end subroutine subbug -- Summary: compiler crash with -O3 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pierphil at xs4all dot nl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40349