The C compiler crashes while compilation of a simple test program with optimizaion -O2 and above.
The bug seems to be triggered by unrolling a loop which contains a "?" operator inside an array index. The crash occured on the gcc versions shipped with SuSE 10.2 (GNU C version 4.1.2 20061115 (prerelease) (SUSE Linux) (i586-suse-linux) ) and Ubuntu 6.10 (gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) ) Here is the output from SuSE: [EMAIL PROTECTED]:~/projects/gcc-crash> gcc -v -save-temps -O2 -o gcc-crash gcc-crash.c Using built-in specs. Target: i586-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --program-suffix=-4.1 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=i586-suse-linux Thread model: posix gcc version 4.1.2 20061115 (prerelease) (SUSE Linux) /usr/lib/gcc/i586-suse-linux/4.1.2/cc1 -E -quiet -v gcc-crash.c -mtune=generic -O2 -fpch-preprocess -o gcc-crash.i #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/i586-suse-linux/4.1.2/include /usr/lib/gcc/i586-suse-linux/4.1.2/../../../../i586-suse-linux/include /usr/include End of search list. /usr/lib/gcc/i586-suse-linux/4.1.2/cc1 -fpreprocessed gcc-crash.i -quiet -dumpbase gcc-crash.c -mtune=generic -auxbase gcc-crash -O2 -version -o gcc-crash.s GNU C version 4.1.2 20061115 (prerelease) (SUSE Linux) (i586-suse-linux) compiled by GNU C version 4.1.2 20061115 (prerelease) (SUSE Linux). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64527 Compiler executable checksum: 56c778b1bb718636fb229d3eaf03526e gcc-crash.c: In function \u2018test_crash\u2019: gcc-crash.c:4: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.opensuse.org> for instructions. -- Summary: C Compiler crash on loop optimization Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: suehring at hhi dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30212