http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59565
Bug ID: 59565 Summary: ICE on valid code in DWARF generation Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: drepper.fsp+rhbz at gmail dot com I see an ICE with both 4.8.2 and the trunk version on the following code when compiled like this: g++ -std=gnu++1y -c bug.cc -g The backtrace is seen below. The code is simple: ================================================================ extern double f1(double); struct s1 { double v; }; inline auto f1(const s1& p) { return s1 { f1(p.v) }; } struct s2 { double v; auto operator-(const s2& r) const { return s2 { v - r.v }; } }; struct s3 { double v; s1 operator/(const s3& r) const { return s1 { v / r.v }; } }; void f2(s3 p1, s3 p2) { auto d1 = f1(p1 / p2); } ================================================================ Notice that s2 is actually not used yet remove the definition or just the inline function and it works. NN.cc:10:8: internal compiler error: in gen_type_die_with_usage, at dwarf2out.c:19823 struct s2 ^ 0x8fd836 gen_type_die_with_usage ../../gcc/dwarf2out.c:19823 0x8fa3cd gen_decl_die ../../gcc/dwarf2out.c:20320 0x8fc4dc gen_member_die ../../gcc/dwarf2out.c:19384 0x8fc4dc gen_struct_or_union_type_die ../../gcc/dwarf2out.c:19456 0x8fc4dc gen_tagged_type_die ../../gcc/dwarf2out.c:19646 0x8fd7c5 gen_type_die_with_usage ../../gcc/dwarf2out.c:19793 0x8f9d8f gen_decl_die ../../gcc/dwarf2out.c:20359 0xb02f72 rest_of_type_compilation(tree_node*, int) ../../gcc/passes.c:280 0x680ddd finish_struct_1(tree_node*) ../../gcc/cp/class.c:6588 0x6825f4 finish_struct(tree_node*, tree_node*) ../../gcc/cp/class.c:6753 0x6b48c2 cp_parser_class_specifier_1 ../../gcc/cp/parser.c:19182 0x6b48c2 cp_parser_class_specifier ../../gcc/cp/parser.c:19401 0x6b48c2 cp_parser_type_specifier ../../gcc/cp/parser.c:14292 0x6cd4c1 cp_parser_decl_specifier_seq ../../gcc/cp/parser.c:11537 0x6d4019 cp_parser_simple_declaration ../../gcc/cp/parser.c:11127 0x6b7dc3 cp_parser_block_declaration ../../gcc/cp/parser.c:11076 0x6de7e3 cp_parser_declaration ../../gcc/cp/parser.c:10973 0x6dd4d8 cp_parser_declaration_seq_opt ../../gcc/cp/parser.c:10859 0x6dedcb cp_parser_translation_unit ../../gcc/cp/parser.c:4018 0x6dedcb c_parse_file() ../../gcc/cp/parser.c:31326 Please submit a full bug report,