Bug 43416 - [4.4 regression] internal compiler error in C++ template instantiations at -O3
Summary: [4.4 regression] internal compiler error in C++ template instantiations at -O3
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.4.3
: P3 normal
Target Milestone: 4.4.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-18 03:10 UTC by Wang Lam
Modified: 2010-05-24 07:45 UTC (History)
1 user (show)

See Also:
Host: x86_64-redhat-linux
Target: x86_64-redhat-linux
Build: x86_64-redhat-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Minimized C++ source causing segmentation fault in gcc 4.4.3 at -O3 (1.16 KB, text/plain)
2010-03-18 03:11 UTC, Wang Lam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wang Lam 2010-03-18 03:10:54 UTC
I came across some code that previously compiled at -O3 without complaint on gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) and gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9), but triggered a segmentation fault on gcc 4.4.3.  After minimization, here is the segmentation fault:

$ /net/test-hsa014/wlam/local/gcc-4.4.3/bin/gcc -Wfatal-errors -c -O3 -Wall foo.cc
foo.cc: In member function ‘void TypeRegistry<ValueType>::registerType(int, const ValueType&) [with ValueType = int (*)()]’:
foo.cc:119: 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.

$ /net/test-hsa014/wlam/local/gcc-4.4.3/bin/g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.4.3/configure --prefix=/net/test-hsa014/wlam/local/gcc-4.4.3 --disable-multilib
Thread model: posix
gcc version 4.4.3 (GCC)

(built from the GNU source distribution, though
Comment 1 Wang Lam 2010-03-18 03:11:48 UTC
Created attachment 20137 [details]
Minimized C++ source causing segmentation fault in gcc 4.4.3 at -O3
Comment 2 Wang Lam 2010-03-18 03:14:14 UTC
Oops, the description is truncated:

(built from the GNU source distribution, though the Fedora version of 4.4.3 shows similar behavior--

$ g++ -Wfatal-errors -c -O3 -Wall foo.ccfoo.cc: In member function ‘void TypeRegistry<ValueType>::registerType(int, const ValueType&) [with ValueType = int (*)()]’:
foo.cc:119: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/cc1IzDg0.out file, please attach this to your bugreport.

$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC)

--as well)
Comment 3 Andrew Pinski 2010-03-18 17:55:20 UTC
Works on the trunk.
Comment 4 Andrew Pinski 2010-03-18 17:56:50 UTC
Could be a dup of bug 42871 or PR 43074.
Comment 5 Wang Lam 2010-03-19 04:23:16 UTC
I think you're right--I built gcc trunk at r157545, and I don't see the segmentation fault there.  (Thanks for your quick response!)
Comment 6 Jakub Jelinek 2010-05-24 07:45:05 UTC
Can't reproduce with either branches/gcc-4_4-branch or branches/redhat/gcc-4_4-branch any more.