The polyhedron test mdbx is miscompiled with revision -O2 -ftree-vectorize at 163940:
[macbook] lin/test% gfc mdbx.f90 -O2 -ftree-vectorize -v Driving: gfc -mmacosx-version-min=10.6.4 mdbx.f90 -O2 -ftree-vectorize -v -l gfortran -shared-libgcc Using built-in specs. COLLECT_GCC=gfc COLLECT_LTO_WRAPPER=/opt/gcc/gcc4.6w/libexec/gcc/x86_64-apple-darwin10.4.0/4.6.0/lto-wrapper Target: x86_64-apple-darwin10.4.0 Configured with: ../work/configure --prefix=/opt/gcc/gcc4.6w --enable-languages=c,c++,fortran,objc,obj-c++,java,lto --with-gmp=/opt/sw64 --with-libiconv-prefix=/opt/sw64 --with-system-zlib --with-cloog=/opt/sw64 Thread model: posix gcc version 4.6.0 20100907 (experimental) [trunk revision 163940p4] (GCC) COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.4' '-O2' '-ftree-vectorize' '-v' '-shared-libgcc' '-mtune=generic' /opt/gcc/gcc4.6w/libexec/gcc/x86_64-apple-darwin10.4.0/4.6.0/f951 mdbx.f90 -fPIC -quiet -dumpbase mdbx.f90 -mmacosx-version-min=10.6.4 -mtune=generic -auxbase mdbx -O2 -version -ftree-vectorize -fintrinsic-modules-path /opt/gcc/gcc4.6w/lib/gcc/x86_64-apple-darwin10.4.0/4.6.0/finclude -o /var/folders/LW/LW1oufkMGIqlLpjYn45fBU+++TI/-Tmp-//cceUTsb5.s GNU Fortran (GCC) version 4.6.0 20100907 (experimental) [trunk revision 163940p4] (x86_64-apple-darwin10.4.0) compiled by GNU C version 4.6.0 20100907 (experimental) [trunk revision 163940p4], GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 GNU Fortran (GCC) version 4.6.0 20100907 (experimental) [trunk revision 163940p4] (x86_64-apple-darwin10.4.0) compiled by GNU C version 4.6.0 20100907 (experimental) [trunk revision 163940p4], GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.4' '-O2' '-ftree-vectorize' '-v' '-shared-libgcc' '-mtune=generic' as -arch x86_64 -force_cpusubtype_ALL -o /var/folders/LW/LW1oufkMGIqlLpjYn45fBU+++TI/-Tmp-//ccBHSNwY.o /var/folders/LW/LW1oufkMGIqlLpjYn45fBU+++TI/-Tmp-//cceUTsb5.s COMPILER_PATH=/opt/gcc/gcc4.6w/libexec/gcc/x86_64-apple-darwin10.4.0/4.6.0/:/opt/gcc/gcc4.6w/libexec/gcc/x86_64-apple-darwin10.4.0/4.6.0/:/opt/gcc/gcc4.6w/libexec/gcc/x86_64-apple-darwin10.4.0/:/opt/gcc/gcc4.6w/lib/gcc/x86_64-apple-darwin10.4.0/4.6.0/:/opt/gcc/gcc4.6w/lib/gcc/x86_64-apple-darwin10.4.0/ LIBRARY_PATH=/opt/gcc/gcc4.6w/lib/gcc/x86_64-apple-darwin10.4.0/4.6.0/:/opt/gcc/gcc4.6w/lib/gcc/x86_64-apple-darwin10.4.0/4.6.0/../../../:/usr/lib/ COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.4' '-O2' '-ftree-vectorize' '-v' '-shared-libgcc' '-mtune=generic' /opt/gcc/gcc4.6w/libexec/gcc/x86_64-apple-darwin10.4.0/4.6.0/collect2 -dynamic -arch x86_64 -macosx_version_min 10.6.4 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.5.o -L/opt/gcc/gcc4.6w/lib/gcc/x86_64-apple-darwin10.4.0/4.6.0 -L/opt/gcc/gcc4.6w/lib/gcc/x86_64-apple-darwin10.4.0/4.6.0/../../.. /var/folders/LW/LW1oufkMGIqlLpjYn45fBU+++TI/-Tmp-//ccBHSNwY.o -lgfortran -lgcc_ext.10.5 -lgcc -no_compact_unwind -lSystem COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.4' '-O2' '-ftree-vectorize' '-v' '-shared-libgcc' '-mtune=generic' [macbook] lin/test% a.out MDBNCH: A MOLECULAR DYNAMICS BENCHMARK, VERSION OF DECEMBER 17, 1988 Segmentation fault Backtrace Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 0x0000000100007d40 in centcm_ () (gdb) bt #0 0x0000000100007d40 in centcm_ () #1 0x00000001000086f1 in mte_ () The Segmentation fault occurs within the loop (lines 2073 to 2080): DO i = 1 , MOLsa X0(1,i) = X0(1,i) - cm1 X0(2,i) = X0(2,i) - cm2 X0(3,i) = X0(3,i) - cm3 XIN(1,i) = XIN(1,i) - cm1 XIN(2,i) = XIN(2,i) - cm2 XIN(3,i) = XIN(3,i) - cm3 ENDDO and disappears with -fbounds-check. Revision 163913 works. It may be due to revision 163915. -- Summary: [4.6 Regression] The polyhedron test mdbx is miscompiled with -O2 -ftree-vectorize at revision 163940 Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dominiq at lps dot ens dot fr GCC build triplet: x86_64-apple-darwin10 GCC host triplet: x86_64-apple-darwin10 GCC target triplet: x86_64-apple-darwin10 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45578