https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101881
Bug ID: 101881
Summary: [9/10/11/12 Regression] ICE with vector type in
template alias
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reichelt at gcc dot gnu.org
Target Milestone: ---
The following valid code snippet triggers an ICE since GCC 7.1.0:
=================================================================
template<int N> using A = int __attribute__((vector_size(N)))*;
void foo(A<4>) {}
=================================================================
bug.cc:3:6: internal compiler error: in add_substitution, at cp/mangle.c:462
void foo(A<4>) {}
^~~
0x8014a5 add_substitution
../../gcc-7.5.0/gcc/cp/mangle.c:461
0x7fa97b write_type
../../gcc-7.5.0/gcc/cp/mangle.c:2413
0x7fd114 write_method_parms
../../gcc-7.5.0/gcc/cp/mangle.c:2828
0x7fd3f6 write_bare_function_type
../../gcc-7.5.0/gcc/cp/mangle.c:2764
0x80505c mangle_decl_string
../../gcc-7.5.0/gcc/cp/mangle.c:3821
0x8053c3 get_mangled_id
../../gcc-7.5.0/gcc/cp/mangle.c:3843
0x8053c3 mangle_decl(tree_node*)
../../gcc-7.5.0/gcc/cp/mangle.c:3913
0x102833e decl_assembler_name(tree_node*)
../../gcc-7.5.0/gcc/tree.c:671
0x1077ac7 notice_global_symbol(tree_node*)
../../gcc-7.5.0/gcc/varasm.c:1656
0x96fdd9 cgraph_node::finalize_function(tree_node*, bool)
../../gcc-7.5.0/gcc/cgraphunit.c:442
0x7b5e9f expand_or_defer_fn(tree_node*)
../../gcc-7.5.0/gcc/cp/semantics.c:4321
0x74a3a9 cp_parser_function_definition_after_declarator
../../gcc-7.5.0/gcc/cp/parser.c:26468
0x74b07e cp_parser_function_definition_from_specifiers_and_declarator
../../gcc-7.5.0/gcc/cp/parser.c:26371
0x74b07e cp_parser_init_declarator
../../gcc-7.5.0/gcc/cp/parser.c:19353
0x745e3c cp_parser_simple_declaration
../../gcc-7.5.0/gcc/cp/parser.c:12886
0x746d77 cp_parser_block_declaration
../../gcc-7.5.0/gcc/cp/parser.c:12711
0x7511e4 cp_parser_declaration
../../gcc-7.5.0/gcc/cp/parser.c:12609
0x75161b cp_parser_declaration_seq_opt
../../gcc-7.5.0/gcc/cp/parser.c:12485
0x751902 cp_parser_translation_unit
../../gcc-7.5.0/gcc/cp/parser.c:4368
0x751902 c_parse_file()
../../gcc-7.5.0/gcc/cp/parser.c:38643
Please submit a full bug report, [etc.]
This is related to PR 83997, but without -flto. And we have a regression.