https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101533

            Bug ID: 101533
           Summary: ICE in gen_type_die_with_usage, at dwarf2out.c:25988
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5, with option -g :


$ cat z1.cc
template <typename> class T
{
  typedef struct {} a __attribute__((aligned));
};
void f ()
{
  T<int>();
}


$ g++-12-20210718 -c z1.cc
$
$ g++-12-20210718 -c z1.cc -g
z1.cc: In instantiation of 'class T<int>':
z1.cc:7:10:   required from here
z1.cc:1:27: internal compiler error: in gen_type_die_with_usage, at
dwarf2out.c:25988
    1 | template <typename> class T
      |                           ^
0xa138e0 gen_type_die_with_usage
        ../../gcc/dwarf2out.c:25988
0xa13916 gen_type_die
        ../../gcc/dwarf2out.c:26191
0xa13f53 modified_type_die
        ../../gcc/dwarf2out.c:13817
0xa15643 add_type_attribute
        ../../gcc/dwarf2out.c:22131
0xa2b017 gen_typedef_die
        ../../gcc/dwarf2out.c:25867
0xa1010c gen_decl_die
        ../../gcc/dwarf2out.c:26833
0xa11d6f gen_member_die
        ../../gcc/dwarf2out.c:25644
0xa11d6f gen_struct_or_union_type_die
        ../../gcc/dwarf2out.c:25740
0xa11d6f gen_tagged_type_die
        ../../gcc/dwarf2out.c:25941
0xa12fce gen_type_die_with_usage
        ../../gcc/dwarf2out.c:26136
0xa13916 gen_type_die
        ../../gcc/dwarf2out.c:26191
0xa0fc3e gen_decl_die
        ../../gcc/dwarf2out.c:26830
0xa10d8e dwarf2out_decl
        ../../gcc/dwarf2out.c:27385
0xa10f5c dwarf2out_type_decl
        ../../gcc/dwarf2out.c:27103
0xca35d2 rest_of_type_compilation(tree_node*, int)
        ../../gcc/passes.c:339
0x702735 finish_struct_1(tree_node*)
        ../../gcc/cp/class.c:7523
0x850228 instantiate_class_template_1
        ../../gcc/cp/pt.c:12211
0x850228 instantiate_class_template(tree_node*)
        ../../gcc/cp/pt.c:12251
0x884103 complete_type(tree_node*)
        ../../gcc/cp/typeck.c:143
0x8841cd complete_type_or_maybe_complain(tree_node*, tree_node*, int)
        ../../gcc/cp/typeck.c:156

Reply via email to