Bug 52662 - ICE in replace_reg_with_saved_mem, at caller-save.c:1125
Summary: ICE in replace_reg_with_saved_mem, at caller-save.c:1125
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-22 06:22 UTC by Raymond Russell
Modified: 2012-10-11 23:10 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work: 4.7.0
Known to fail:
Last reconfirmed:


Attachments
Preprocessed code from successful compilation (234.65 KB, application/x-gzip)
2012-03-22 07:48 UTC, Raymond Russell
Details
Preprocessed code that triggered ICE (234.65 KB, application/x-gzip)
2012-03-22 07:49 UTC, Raymond Russell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Russell 2012-03-22 06:22:24 UTC
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.
Comment 1 Raymond Russell 2012-03-22 06:28:07 UTC
The preprocessed output is too large (2028k) to add as an attachment.  I don't have anywhere obvious to post it - do you have any suggestions on how to submit it?
Comment 2 Richard Biener 2012-03-22 07:24:23 UTC
You can compress it.
Comment 3 Raymond Russell 2012-03-22 07:48:56 UTC
Created attachment 26951 [details]
Preprocessed code from successful compilation
Comment 4 Raymond Russell 2012-03-22 07:49:59 UTC
Created attachment 26952 [details]
Preprocessed code that triggered ICE
Comment 5 Raymond Russell 2012-03-22 07:54:11 UTC
Thanks, for some reason I thought compressed output wouldn't be kosher 
(i.e. I wasn't really thinking).  I've attached both sets of 
preprocessed code for completeness.

Many thanks,

Raymond.


On 03/22/12 07:24, rguenth at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52662
>
> --- Comment #2 from Richard Guenther<rguenth at gcc dot gnu.org>  2012-03-22 07:24:23 UTC ---
> You can compress it.
>
Comment 6 Paolo Carlini 2012-10-11 23:10:49 UTC
Fixed in 4.7.0.