Hi, Following code causing an ICE with mainline.
elm3b9:/home/pawar> cat test.c 1 int func(float *v1, const float *v2, int l, int e) 2 { 3 int i,j, bi=0; 4 float md=0, d=0, t; 5 for (i=0;i< e;i--) 6 { 7 for (j=0;j<l;j++) 8 { 9 t = v1[j]-*v2++; 10 d += t*t; 11 } 12 if ( d > md) 13 md=d; 14 } 15 } $ /opt/gcc-nightly/trunk-20060123/bin/gcc -v -c -O2 -ftree-loop-linear test.c Using built-in specs. Target: powerpc64-linux Configured with: /home/gccbuild/gcc_trunk_anonsvn/trunk/configure --prefix=/opt/gcc-nightly/trunk-20060123 --build=powerpc64-linux --host=powerpc64-linux --target=powerpc64-linux --with-cpu=default32 --with-as=/opt/gcc-nightly/trunk-20060123/bin/as --with-ld=/opt/gcc-nightly/trunk-20060123/bin/ld --enable-threads=posix --enable-shared --enable-__cxa_atexit --enable-languages=c,c++,f95,java,objc --enable-checking --with-mpfr=/opt/gcc-nightly/trunk-20060123 Thread model: posix gcc version 4.2.0 20060123 (experimental) /home/gcc-nightly/trunk-20060123/bin/../libexec/gcc/powerpc64-linux/4.2.0/cc1 -quiet -v -iprefix /home/gcc-nightly/trunk-20060123/bin/../lib/gcc/powerpc64-linux/4.2.0/ -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=linux -Asystem=unix -Asystem=posix test.c -quiet -dumpbase test.c -auxbase test -O2 -version -ftree-loop-linear -o /tmp/cc145sWC.s ignoring nonexistent directory "/home/gcc-nightly/trunk-20060123/bin/../lib/gcc/powerpc64-linux/4.2.0/../../../../powerpc64-linux/include" ignoring duplicate directory "/opt/gcc-nightly/trunk-20060123/lib/gcc/powerpc64-linux/4.2.0/include" ignoring nonexistent directory "/opt/gcc-nightly/trunk-20060123/lib/gcc/powerpc64-linux/4.2.0/../../../../powerpc64-linux/include" #include "..." search starts here: #include <...> search starts here: /home/gcc-nightly/trunk-20060123/bin/../lib/gcc/powerpc64-linux/4.2.0/include /usr/local/include /opt/gcc-nightly/trunk-20060123/include /usr/include End of search list. GNU C version 4.2.0 20060123 (experimental) (powerpc64-linux) compiled by GNU C version 4.2.0 20060123 (experimental). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: ab2acf781189b94f37d1814045ecf667 test.c: In function func: test.c:2: internal compiler error: Illegal instruction Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. If I remove -v option from the command line, I get following, $ /opt/gcc-nightly/trunk-20060123/bin/gcc -c -O2 -ftree-loop-linear test.c gcc: Internal error: Segmentation fault (program cc1) Please submit a full bug report. See <URL:http://gcc.gnu.org/bugs.html> for instructions. If I remove, declaration bi=0 from line 3, I get following, $ elm3b11:/home/pawar/reghunt/work> /opt/gcc-nightly/trunk-20060123/bin/gcc -c -O2 -ftree-loop-linear test.c test.c: In function func: test.c:2: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. On line 5, if change i-- to i++, I get following (without bi=0), $ elm3b11:/home/pawar/reghunt/work> /opt/gcc-nightly/trunk-20060123/bin/gcc -c -O2 -ftree-loop-linear test.c test.c: In function func: test.c:2: error: definition in block 17 does not dominate use in block 6 for SSA_NAME: v2_38 in statement: v2_42 = PHI <v2_38(6), v2_31(11)>; PHI argument v2_38 for PHI node v2_42 = PHI <v2_38(6), v2_31(11)>; test.c:2: internal compiler error: verify_ssa failed Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. and with bi=0, on line 3 I get, $ elm3b11:/home/pawar/reghunt/work> /opt/gcc-nightly/trunk-20060123/bin/gcc -c -O2 -ftree-loop-linear test.c test.c: In function func: test.c:2: error: definition in block 17 does not dominate use in block 6 for SSA_NAME: v2_38 in statement: v2_42 = PHI <v2_38(6), v2_9(11)>; PHI argument v2_38 for PHI node v2_42 = PHI <v2_38(6), v2_9(11)>; test.c:2: internal compiler error: verify_ssa failed Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. -- Summary: ICE: Illegal instruction, with valid code Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: uttamp at us dot ibm dot com GCC build triplet: powerpc64-linux GCC host triplet: powerpc64-linux GCC target triplet: powerpc64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25937