I compiled the GCC snapshot from 2010-01-07 on 32bit Ubuntu 10.04. I got the same results using the SVN version from last night (Jan 12, 2010) on 64bit Ubuntu 9.04.
The snippet is nonsensical, but it compiles fine with 4.3.3 and 4.4.3. So far I've only noticed the error when using '-O2', '-O3', '-Os', or '-O -ftree-vrp'. With each of those flags, the error does not occur if you also supply '-fno-exceptions'. I wonder if it's related to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42698 gott...@boosh:~/gsl$ cat ICE.cpp struct s { ~s() { s(); }}; int f() { M: s o = s(); f(); f(); L: goto *(f() ? &&L : &&M); return 0; } gott...@boosh:~/gsl$ g++4.5- -v -S -O2 ICE.cpp Using built-in specs. COLLECT_GCC=g++4.5- COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: ./configure --enable-lto --program-suffix=4.5- Thread model: posix gcc version 4.5.0 20100107 (experimental) (GCC) COLLECT_GCC_OPTIONS='-v' '-S' '-O2' '-shared-libgcc' '-mtune=generic' /usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.0/cc1plus -quiet -v -D_GNU_SOURCE ICE.cpp -quiet -dumpbase ICE.cpp -mtune=generic -auxbase ICE -O2 -version -o ICE.s GNU C++ (GCC) version 4.5.0 20100107 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 4.5.0 20100107 (experimental), GMP version 4.3.1, MPFR version 2.4.2-p1, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ignoring nonexistent directory "/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../include/c++/4.5.0 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../include/c++/4.5.0/i686-pc-linux-gnu /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../include/c++/4.5.0/backward /usr/local/include /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/include /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/include-fixed /usr/include End of search list. GNU C++ (GCC) version 4.5.0 20100107 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 4.5.0 20100107 (experimental), GMP version 4.3.1, MPFR version 2.4.2-p1, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 06ee28012e9fee55f767de400b682e47 ICE.cpp: In function int f(): ICE.cpp:2:5: internal compiler error: in redirect_eh_edge_1, at tree-eh.c:2112 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. -- Summary: [4.5 Regression] ICE with computed goto, destructors, and optimization Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gottreu at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42739