http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52662
Bug #: 52662 Summary: ICE in replace_reg_with_saved_mem, at caller-save.c:1125 Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: raym...@corvil.com I made a small code-change, moving an assignment into the else-branch of an if-statement, and this change triggered the ICE. This is on a 64-bit system, and only happens when compiling 32-bit code; the same code doesn't trigger the ICE in 64-bit mode. I'm sorry I haven't been able to reduce this to a small test-case but even the smallest code change makes all the difference. Here is a diff showing the change: $ diff -U 7 okay.IpPkt.ii ICE.IpPkt.ii --- okay.IpPkt.ii 2012-03-22 05:54:34.499872293 +0000 +++ ICE.IpPkt.ii 2012-03-22 05:54:59.290872957 +0000 @@ -76207,16 +76207,16 @@ template<typename _Type> void merge(const _Type *data, size_t size = sizeof(_Type)) { if( m_hash_width == HASH_WIDTH_0 ) { const uint8_t *begin = reinterpret_cast< const uint8_t *>(data); m_data.insert(m_data.end(), begin, begin + size); - } - m_hash = Hashing::hash(m_hash, data, size); + } else + m_hash = Hashing::hash(m_hash, data, size); } protected: ShellGUID uintGUID(size_t width) { ( (void)0 ); I will attach the full pre-processed code for both the successful compilation and for the ICE; here is the output from "g++ -v": $ g++ -v -save-temps -m32 -g -O3 -fPIC -Wall -Wextra -W -Wundef -Wpointer-arith -Wsign-promo -Woverloaded-virtual -Wreorder -DARDEA_VERSION="\"r70118M\"" -I./lib/include -I./src -I./lib/include -I./src -c -o obj/plugins/IpPkt.o src/plugins/IpPkt.cpp Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /usr/Taw/tmp/gcc-4.6.1/configure --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/lib64 --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-clocale=gnu --enable-__cxa_atexit --enable-languages=c,c++,fortran --enable-c99 --enable-long-long Thread model: posix gcc version 4.6.1 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m32' '-g' '-O3' '-fPIC' '-Wall' '-Wextra' '-Wundef' '-Wpointer-arith' '-Wsign-promo' '-Woverloaded-virtual' '-Wreorder' '-D' 'ARDEA_VERSION="r70118M"' '-I' './lib/include' '-I' './src' '-I' './lib/include' '-I' './src' '-c' '-o' 'obj/plugins/IpPkt.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus -E -quiet -v -I ./lib/include -I ./src -I ./lib/include -I ./src -imultilib 32 -D_GNU_SOURCE -D ARDEA_VERSION="r70118M" src/plugins/IpPkt.cpp -m32 -mtune=generic -march=x86-64 -Wall -Wextra -Wundef -Wpointer-arith -Wsign-promo -Woverloaded-virtual -Wreorder -fPIC -g -fworking-directory -O3 -fpch-preprocess -o IpPkt.ii ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/include" ignoring duplicate directory "./lib/include" ignoring duplicate directory "./src" #include "..." search starts here: #include <...> search starts here: ./lib/include ./src /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/x86_64-unknown-linux-gnu/32 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/backward /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m32' '-g' '-O3' '-fPIC' '-Wall' '-Wextra' '-Wundef' '-Wpointer-arith' '-Wsign-promo' '-Woverloaded-virtual' '-Wreorder' '-D' 'ARDEA_VERSION="r70118M"' '-I' './lib/include' '-I' './src' '-I' './lib/include' '-I' './src' '-c' '-o' 'obj/plugins/IpPkt.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus -fpreprocessed IpPkt.ii -quiet -dumpbase IpPkt.cpp -m32 -mtune=generic -march=x86-64 -auxbase-strip obj/plugins/IpPkt.o -g -O3 -Wall -Wextra -Wundef -Wpointer-arith -Wsign-promo -Woverloaded-virtual -Wreorder -version -fPIC -o IpPkt.s GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.1.0, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.1.0, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 65eaa1b8603a14c0584988a2c1fafc0e src/plugins/IpPkt.cpp: In member function 'virtual void IpPkt::IpFlow::handleFwdPacket(const ardea::net::IpSnap&)': src/plugins/IpPkt.cpp:188:1: internal compiler error: in replace_reg_with_saved_mem, at caller-save.c:1125 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.