https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70332
Bug ID: 70332 Summary: ICE on x86_64-linux-gnu in tsubst_copy, at cp/pt.c:13887 Product: gcc Version: 6.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 code causes an ICE when compiled with the current GCC trunk (and 5.x) on x86_64-linux-gnu in both 32-bit and 64-bit modes. It is a regression from 4.9.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/6.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 6.0.0 20160320 (experimental) [trunk revision 234355] (GCC) $ $ g++-trunk -c -std=c++14 small.cpp small.cpp:4:9: internal compiler error: in tsubst_copy, at cp/pt.c:13887 T m = m; ^ 0x686f54 tsubst_copy ../../gcc-source-trunk/gcc/cp/pt.c:13887 0x6885eb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:16987 0x689a7d tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:16030 0x68998e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:16007 0x68a178 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:16768 0x790ed4 get_nsdmi(tree_node*, bool) ../../gcc-source-trunk/gcc/cp/init.c:568 0x6cc7f0 process_init_constructor_record ../../gcc-source-trunk/gcc/cp/typeck2.c:1415 0x6cc7f0 process_init_constructor ../../gcc-source-trunk/gcc/cp/typeck2.c:1594 0x6cc7f0 digest_init_r ../../gcc-source-trunk/gcc/cp/typeck2.c:1123 0x6ced8a digest_init_flags ../../gcc-source-trunk/gcc/cp/typeck2.c:1168 0x6ced8a store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../gcc-source-trunk/gcc/cp/typeck2.c:802 0x62fa04 check_initializer ../../gcc-source-trunk/gcc/cp/decl.c:6155 0x6595fc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc-source-trunk/gcc/cp/decl.c:6783 0x75279f cp_parser_init_declarator ../../gcc-source-trunk/gcc/cp/parser.c:18658 0x752f50 cp_parser_simple_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12379 0x753261 cp_parser_block_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12248 0x75bdd0 cp_parser_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12145 0x75a894 cp_parser_declaration_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:12024 0x75abc8 cp_parser_translation_unit ../../gcc-source-trunk/gcc/cp/parser.c:4323 0x75abc8 c_parse_file() ../../gcc-source-trunk/gcc/cp/parser.c:37408 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. $ $ g++-4.9 -c -std=c++14 small.cpp $ $ clang++-trunk -c -std=c++14 small.cpp $ ------------------------- template <class T> struct C { T m = m; }; C <int> c {};