http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50338
Bug #: 50338 Summary: ICE Linking with -flto Classification: Unclassified Product: gcc Version: lto Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: james.w.mckel...@jpl.nasa.gov When I compile and link with -flto, I get this error: make[1]: Entering directory `/home/mckelvey/PD/testsuite' rm -f stest0.exe /usr/local/bin/g++ -O3 -DNDEBUG -DUSE_INTL=1 -DUSE_MUTEX=1 -findirect-inlining -flto -pedantic -std=gnu++0x -ansi -fno-common -Wall -Wold-style-cast -Wsign-promo -Wpointer-arith -Wundef -Wwrite-strings -Winvalid-pch -Woverloaded-virtual -Wcast-qual -Wextra -Wredundant-decls -Wshadow -Wcast-align -Wcomment -fstrict-aliasing -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wlogical-op -Wconversion -Wsign-conversion -Wmissing-declarations -Wdeprecated -ftree-switch-conversion -Wuninitialized -Wparentheses -Wunused -fvisibility-inlines-hidden -MMD -fimplicit-templates -L.. -o stest0.exe stest0.o -lPatternDriver -lpthread lto1: internal compiler error: in lto_balanced_map, at lto/lto.c:1721 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. lto-wrapper: /usr/local/bin/g++ returned 1 exit status collect2: error: lto-wrapper returned 1 exit status make[1]: *** [stest0.exe] Error 1 Since this is a link error, I don't know what you need to debug this. The files will be large. g++ is very recent. I tried building with --enable-checking=none, but that gives a segmentation fault instead of an ICE. uname -a Linux Mushroom 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-redhat-linux/4.7.0/lto-wrapper Target: x86_64-redhat-linux Configured with: /home/mckelvey/cvsroot/gcc/configure --verbose --disable-nls --enable-lto --with-mpfr=/usr/local --with-gmp=/usr/local --with-mpc=/usr/local --with-ppl=/usr/local --with-cloog=/usr/local --enable-cloog-backend=isl --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --disable-dssi --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --enable-languages=c,c++ Thread model: posix gcc version 4.7.0 20110907 (experimental) (GCC) BUILDING: alias CONFIGURECVS='export CC=gcc ; /home/mckelvey/cvsroot/gcc/configure --verbose --disable-nls --enable-lto --with-mpfr=/usr/local --with-gmp=/usr/local --with-mpc=/usr/local --with-ppl=/usr/local --with-cloog=/usr/local --enable-cloog-backend=isl --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --disable-dssi --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --enable-languages=c,c++ 2>&1 | tee clog' alias BUILD='nice make CFLAGS='\'''\'' BOOT_CFLAGS='\'''\'' LIBCFLAGS='\''-g -O'\'' CXXFLAGS='\''-O'\'' LIBCXXFLAGS='\''-g -O'\'' 2>&1 | tee log'