http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50207
Bug #: 50207 Summary: G++ segv's on reduced test case Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: berg...@gcc.gnu.org A G++ from today's trunk (20110826) segv's on a reduced test case (using delta) like so: bergner@igoo:~> cat minimal.ii typedef long unsigned int size_t; namespace std __attribute__ ((__visibility__ ("default"))) { using::size_t; } typedef unsigned char uint8_t; namespace std { namespace decimal { template < class _Fmt > struct _FmtTraits; class decimal32; } } namespace std { namespace decimal { template <> class _FmtTraits < decimal32 > { public: static const std::size_t _NumBytes = 4UL; }; template < class _Tr > class _DecBase { uint8_t _Bytes[_Tr::_NumBytes]; }; class decimal32:public _DecBase < _FmtTraits < decimal32 > > { decimal32 () { } }; } } bergner@igoo:~> /home/bergner/gcc/install/gcc-mainline-debug/bin/g++ -Wall -S minimal.ii g++: internal compiler error: Segmentation fault (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. GDB show this backtrace: #0 0x0000000010412cc8 in decl_is_template_id (decl=0xfffb6edcc18, template_info=0xfffb6edcc18) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:267 #1 0x000000001041b44c in write_nested_name (decl=0xfffb6e24ac0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:928 #2 0x000000001041ab48 in write_name (decl=0xfffb6e24ac0, ignore_local_scope=0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:855 #3 0x00000000104284e4 in write_class_enum_type (type=0xfffb6edd4a0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2398 #4 0x0000000010424840 in write_type (type=0xfffb6edd4a0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:1884 #5 0x000000001042d1ec in write_template_arg (node=0xfffb6edcc18) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2843 #6 0x0000000010428868 in write_template_args (args=0xfffb6f13a70) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2427 #7 0x000000001041b50c in write_nested_name (decl=0xfffb6e245b8) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:932 #8 0x000000001041ab48 in write_name (decl=0xfffb6e245b8, ignore_local_scope=0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:855 #9 0x00000000104284e4 in write_class_enum_type (type=0xfffb6edccc0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2398 #10 0x0000000010424840 in write_type (type=0xfffb6edccc0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:1884 #11 0x000000001042d1ec in write_template_arg (node=0xfffb6edccc0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2843 #12 0x0000000010428868 in write_template_args (args=0xfffb6f14088) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2427 #13 0x000000001041b50c in write_nested_name (decl=0xfffb6e24ac0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:932 #14 0x000000001041ab48 in write_name (decl=0xfffb6e24ac0, ignore_local_scope=0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:855 #15 0x00000000104284e4 in write_class_enum_type (type=0xfffb6edd4a0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2398 #16 0x0000000010424840 in write_type (type=0xfffb6edd4a0) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:1884 #17 0x000000001042d1ec in write_template_arg (node=0xfffb6edcc18) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2843 #18 0x0000000010428868 in write_template_args (args=0xfffb6f13a70) at /home/bergner/gcc/gcc-mainline-base/gcc/cp/mangle.c:2427 ... The backtrace also show we have 10's of thousands of frames stacked repeated over and over, so it looks like we've gone into some type of infinite recursion. A quick look at GCC 4.6 show's it fails in the same manner. I haven't checked anything earlier.