The following inocent looking C function: void KWayNodeRefine__(int nparts, int *gpwgts, int *badminpwgt, int *badmaxpwgt) { int i;
for (i=0; i<nparts; i+=2) { badminpwgt[i] = badminpwgt[i+1] = gpwgts[i]+gpwgts[i+1]; badmaxpwgt[i] = badmaxpwgt[i+1] = gpwgts[i]+gpwgts[i+1]; } } when compiled with gcc 4.5.0 generate an internal compiler error: [au...@mc1 experiences]$ g++ -O3 -c nr.c nr.c: In function 'void KWayNodeRefine__(int, int*, int*, int*)': nr.c:2:6: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. [au...@mc1 experiences]$ Note that there is no such error with -O2 or without options or when gcc 4.4.2 is used. Note also that the code above originate from ParMetis (parallel graph partitionner). I simplified it the most I could (and I think we cannot simplify it further to still triger the gcc ICE). Now here are some information about my system: [au...@mc1 experiences]$ gcc --version gcc (GCC) 4.5.0 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [au...@mc1 experiences]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/publique/gcc45/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.5.0/configure --prefix=/usr/local/gcc45 --enable-shared --enable-threads=posix --with-system-zlib --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1 --with-ppl=/usr/local/ppl-0.10.2 --with-cloog=/usr/local/cloog-ppl-0.15.9 --with-libelf=/usr/local/libelf-0.8.12 --enable-__cxa_atexit --enable-languages=c,c++,fortran Thread model: posix gcc version 4.5.0 (GCC) [au...@mc1 experiences]$ uname -a Linux mc1 2.6.22.9-91.fc7 #1 SMP Thu Jun 18 16:01:22 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux [au...@mc1 experiences]$ As you can see my system uses Fedora Linux 7 distribution. gcc was compiled and tested (make -k check) this morning on this machine. Only a small fraction of the tests failled. Regards, -- Summary: ICE on valid when compiling ParMetis with gcc 4.5.0 and -O3 Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: martin dot audet at imi dot cnrc-nrc dot gc dot ca http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43771