http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55652
Bug #: 55652
Summary: [C++11][4.8] ICE (segfault) with templates and structs
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 28929
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28929
testcase used.
Hi folks,
I have started re-compiling my RPMs with GNU GCC 4.8.0 (revision 194323) to
check the status.
Below your will find the smallest test case I currently could produce showing
setfault (ICE). Yet I am still not fully sure what is causing it. I compiles w/
C++03, but not w/ C++11. It also compiles w/ GCC 4.7.2.
I am attaching *.ii.
## TESTCASE ##
#include <map>
template <typename T1, typename T2>
struct P {
T1 first;
T2 second;
P() : first(T1()), second(T2()) {}
};
struct E {
};
struct B {
B();
B(const B &obj) throw(E);
};
int main(void) {
P<B, std::map<B, B> > a;
return 0;
}
## COMPILE LINE ##
g++ -v -save-temps -std=c++11 -c -o test.o ./test.cxx
## GCC OUTPUT ##
./test.cxx: In function 'int main()':
./test.cxx:19:25: internal compiler error: Segmentation fault
P<B, std::map<B, B> > a;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
## GCC FULL OUTPUT ##
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-unknown-linux-gnu
Configured with: ../configure
--prefix=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--disable-multilib --disable-nls --enable-languages=c,c++,fortran
--enable-gold=yes --enable-lto
--with-gmp=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-mpfr=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-mpc=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-isl=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-cloog=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--disable-isl-version-check --enable-shared CC='gcc -fPIC' CXX='c++ -fPIC'
CPP=cpp CXXCPP='c++ -E'
Thread model: posix
gcc version 4.8.0 20121208 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-c' '-o' 'test.o'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-E -quiet -v -iprefix
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/
-D_GNU_SOURCE ./test.cxx -mtune=generic -march=x86-64 -std=c++11
-fpch-preprocess -o test.ii
ignoring nonexistent directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed"
ignoring nonexistent directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed
/usr/local/include
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../include
/usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-c' '-o' 'test.o'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-fpreprocessed test.ii -quiet -dumpbase test.cxx -mtune=generic -march=x86-64
-auxbase-strip test.o -std=c++11 -version -o test.s
GNU C++ (GCC) version 4.8.0 20121208 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.8.0 20121208 (experimental), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.8.0 20121208 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.8.0 20121208 (experimental), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7710cb843e8b8b547eb436a388da025f
./test.cxx: In function 'int main()':
./test.cxx:19:25: internal compiler error: Segmentation fault
P<B, std::map<B, B> > a;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.