https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71513
Bug ID: 71513 Summary: ICE on valid C++11 code (with alignas specifier) on x86_64-linux-gnu: Segmentation fault Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- The following C++11 code causes an ICE when compiled with the current GCC trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. It also affects 6.1.x and is a regression from 5.4.x. $ g++-trunk -v Using built-in specs. COLLECT_GCC=g++-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160612 (experimental) [trunk revision 237336] (GCC) $ $ g++-5.4 -std=c++11 -c small.cpp $ clang++-3.8 -std=c++11 -c small.cpp $ $ g++-trunk -std=c++11 -c small.cpp small.cpp: In instantiation of ‘class A<1, char>’: small.cpp:7:15: required from here small.cpp:4:24: internal compiler error: Segmentation fault enum alignas (N) E : T; ^ 0xdb2b7f crash_signal ../../gcc-source-trunk/gcc/toplev.c:335 0x6fd083 contains_struct_check ../../gcc-source-trunk/gcc/tree.h:3143 0x6fd083 tsubst_attributes ../../gcc-source-trunk/gcc/cp/pt.c:9669 0x6fd083 lookup_template_class_1 ../../gcc-source-trunk/gcc/cp/pt.c:8425 0x6fd083 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) ../../gcc-source-trunk/gcc/cp/pt.c:8654 0x6feb0b tsubst_aggr_type ../../gcc-source-trunk/gcc/cp/pt.c:11437 0x6e7df7 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:12908 0x6f0425 tsubst_decl ../../gcc-source-trunk/gcc/cp/pt.c:12229 0x6e81fe tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:12829 0x71bb64 instantiate_class_template_1 ../../gcc-source-trunk/gcc/cp/pt.c:10091 0x71bb64 instantiate_class_template(tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:10372 0x7be313 complete_type(tree_node*) ../../gcc-source-trunk/gcc/cp/typeck.c:132 0x683ee8 start_decl_1(tree_node*, bool) ../../gcc-source-trunk/gcc/cp/decl.c:5070 0x6aacad start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc-source-trunk/gcc/cp/decl.c:5033 0x7aa4b2 cp_parser_init_declarator ../../gcc-source-trunk/gcc/cp/parser.c:18566 0x7ab009 cp_parser_simple_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12378 0x7ab311 cp_parser_block_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12246 0x7b46f0 cp_parser_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12143 0x7b31c4 cp_parser_declaration_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:12022 0x7b34f8 cp_parser_translation_unit ../../gcc-source-trunk/gcc/cp/parser.c:4324 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ ---------------------------------- template < int N, typename T > class A { enum alignas (N) E : T; }; A < 1, char > a;