https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72808
Bug ID: 72808 Summary: [6/7 Regression] ICE on valid c++ code in verify_type (gcc/tree.c:14047) Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org Target Milestone: --- I've just isolated following snippet from Firefox master: typedef int uint32_t; class A { virtual void m_fn1 (); }; class B : A { void m_fn1 (); enum TrackCommands : uint32_t; }; enum B::TrackCommands : uint32_t { TRACK_EVENT_UNUSED }; void B::m_fn1 () { } $ g++ reduced.ii -g reduced.ii:18:1: error: type variant has different TYPE_FIELDS } ^ <record_type 0x7f274761b000 B addressable asm_written tree_2 needs-constructing type_5 type_6 BLK size <integer_cst 0x7f27474aae58 type <integer_type 0x7f27474ae2a0 bitsizetype> constant 64> unit size <integer_cst 0x7f27474aae70 type <integer_type 0x7f27474ae1f8 sizetype> constant 8> align 64 symtab 1196241216 alias set -1 canonical type 0x7f274761b000 fields <const_decl 0x7f27474c62a0 TRACK_EVENT_UNUSED type <enumeral_type 0x7f274761b3f0 TrackCommands type <integer_type 0x7f2747612c78 uint32_t> asm_written type_5 SI size <integer_cst 0x7f27474cb0a8 constant 32> unit size <integer_cst 0x7f27474cb0c0 constant 4> align 32 symtab 1196241296 alias set -1 canonical type 0x7f274761b3f0 precision 32 min <integer_cst 0x7f27474cb060 -2147483648> max <integer_cst 0x7f27474cb078 2147483647> values <tree_list 0x7f2747609eb0 purpose <identifier_node 0x7f2747614528 TRACK_EVENT_UNUSED bindings <(nil)> local bindings <(nil)>> value <const_decl 0x7f27474c62a0 TRACK_EVENT_UNUSED>> context <record_type 0x7f274761b000 B> chain <type_decl 0x7f2747613850 TrackCommands>> readonly constant private VOID file reduced.ii line 13 col 3 align 1 context <enumeral_type 0x7f274761b3f0 TrackCommands> initial <integer_cst 0x7f27475ffa08 0> chain <field_decl 0x7f27476138e8 D.2261 type <record_type 0x7f2747612e70 A> ignored decl_6 BLK file reduced.ii line 6 col 7 size <integer_cst 0x7f27474aae58 64> unit size <integer_cst 0x7f27474aae70 8> align 64 offset_align 128 offset <integer_cst 0x7f27474aae88 constant 0> bit offset <integer_cst 0x7f27474aaed0 constant 0> context <record_type 0x7f274761b000 B> chain <type_decl 0x7f27476137b8 B>>> context <translation_unit_decl 0x7f27474b6168 D.1> full-name "class B" needs-constructor X() X(constX&) this=(X&) n_parents=1 use_template=0 pointer_to_this <pointer_type 0x7f274761b2a0> chain <type_decl 0x7f2747613720 B>> reduced.ii:18:1: error: first mismatch is field <field_decl 0x7f27476138e8 D.2261 type <record_type 0x7f2747612e70 A addressable tree_2 needs-constructing type_5 type_6 BLK size <integer_cst 0x7f27474aae58 constant 64> unit size <integer_cst 0x7f27474aae70 constant 8> align 64 symtab 1196241536 alias set -1 canonical type 0x7f2747612e70 fields <field_decl 0x7f2747613558 _vptr.A type <pointer_type 0x7f274760e498> unsigned virtual DI file reduced.ii line 2 col 7 size <integer_cst 0x7f27474aae58 64> unit size <integer_cst 0x7f27474aae70 8> align 64 offset_align 128 offset <integer_cst 0x7f27474aae88 constant 0> bit offset <integer_cst 0x7f27474aaed0 constant 0> context <record_type 0x7f2747612e70 A> chain <type_decl 0x7f27476134c0 A>> context <translation_unit_decl 0x7f27474b6168 D.1> full-name "class A" needs-constructor X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown pointer_to_this <pointer_type 0x7f2747612888> chain <type_decl 0x7f2747613428 A>> ignored decl_6 BLK file reduced.ii line 6 col 7 size <integer_cst 0x7f27474aae58 64> unit size <integer_cst 0x7f27474aae70 8> align 64 offset_align 128 offset <integer_cst 0x7f27474aae88 0> bit offset <integer_cst 0x7f27474aaed0 0> context <record_type 0x7f274761b000 B> chain <type_decl 0x7f27476137b8 B>> reduced.ii:18:1: error: and field <const_decl 0x7f27474c62a0 TRACK_EVENT_UNUSED type <enumeral_type 0x7f274761b3f0 TrackCommands type <integer_type 0x7f2747612c78 uint32_t public type_6 SI size <integer_cst 0x7f27474cb0a8 constant 32> unit size <integer_cst 0x7f27474cb0c0 constant 4> align 32 symtab 1196240976 alias set -1 canonical type 0x7f27474ae7e0 precision 32 min <integer_cst 0x7f27474cb060 -2147483648> max <integer_cst 0x7f27474cb078 2147483647>> asm_written type_5 SI size <integer_cst 0x7f27474cb0a8 32> unit size <integer_cst 0x7f27474cb0c0 4> align 32 symtab 1196241296 alias set -1 canonical type 0x7f274761b3f0 precision 32 min <integer_cst 0x7f27474cb060 -2147483648> max <integer_cst 0x7f27474cb078 2147483647> values <tree_list 0x7f2747609eb0 purpose <identifier_node 0x7f2747614528 TRACK_EVENT_UNUSED bindings <(nil)> local bindings <(nil)>> value <const_decl 0x7f27474c62a0 TRACK_EVENT_UNUSED>> context <record_type 0x7f274761b000 B> chain <type_decl 0x7f2747613850 TrackCommands>> readonly constant private VOID file reduced.ii line 13 col 3 align 1 context <enumeral_type 0x7f274761b3f0 TrackCommands> initial <integer_cst 0x7f27475ffa08 0> chain <field_decl 0x7f27476138e8 D.2261>> <record_type 0x7f274761b0a8 B addressable tree_2 needs-constructing type_5 BLK size <integer_cst 0x7f27474aae58 type <integer_type 0x7f27474ae2a0 bitsizetype> constant 64> unit size <integer_cst 0x7f27474aae70 type <integer_type 0x7f27474ae1f8 sizetype> constant 8> align 64 symtab 0 alias set -1 canonical type 0x7f274761b000 fields <field_decl 0x7f27476138e8 D.2261 type <record_type 0x7f2747612e70 A addressable tree_2 needs-constructing type_5 type_6 BLK size <integer_cst 0x7f27474aae58 64> unit size <integer_cst 0x7f27474aae70 8> align 64 symtab 1196241536 alias set -1 canonical type 0x7f2747612e70 fields <field_decl 0x7f2747613558 _vptr.A> context <translation_unit_decl 0x7f27474b6168 D.1> full-name "class A" needs-constructor X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown pointer_to_this <pointer_type 0x7f2747612888> chain <type_decl 0x7f2747613428 A>> ignored decl_6 BLK file reduced.ii line 6 col 7 size <integer_cst 0x7f27474aae58 64> unit size <integer_cst 0x7f27474aae70 8> align 64 offset_align 128 offset <integer_cst 0x7f27474aae88 constant 0> bit offset <integer_cst 0x7f27474aaed0 constant 0> context <record_type 0x7f274761b000 B> chain <type_decl 0x7f27476137b8 B type <record_type 0x7f274761b0a8 B> nonlocal decl_4 VOID file reduced.ii line 7 col 1 align 1 context <record_type 0x7f274761b000 B> result <record_type 0x7f274761b000 B> chain <type_decl 0x7f2747613850 TrackCommands>>> context <translation_unit_decl 0x7f27474b6168 D.1> full-name "class B" needs-constructor X() X(constX&) this=(X&) n_parents=1 use_template=0 chain <type_decl 0x7f2747613720 B>> reduced.ii:18:1: internal compiler error: verify_type failed 0x10543d2 verify_type(tree_node const*) ../../gcc/tree.c:14047 0xa3c4fc gen_type_die_with_usage ../../gcc/dwarf2out.c:22712 0xa3d8b6 gen_type_die ../../gcc/dwarf2out.c:22910 0xa355b9 gen_decl_die ../../gcc/dwarf2out.c:23502 0xa44048 gen_member_die ../../gcc/dwarf2out.c:22381 0xa44048 gen_struct_or_union_type_die ../../gcc/dwarf2out.c:22487 0xa45566 gen_tagged_type_die ../../gcc/dwarf2out.c:22690 0xa3cb8c gen_type_die_with_usage ../../gcc/dwarf2out.c:22855 0xa3d8b6 gen_type_die ../../gcc/dwarf2out.c:22910 0xa355b9 gen_decl_die ../../gcc/dwarf2out.c:23502 0xa35fbe dwarf2out_decl ../../gcc/dwarf2out.c:23962 0xa4da1b dwarf2out_type_decl ../../gcc/dwarf2out.c:23672 0xcd019f rest_of_type_compilation(tree_node*, int) ../../gcc/passes.c:333 0x8052a5 note_debug_info_needed(tree_node*) ../../gcc/cp/search.c:2365 0x762d3e maybe_emit_vtables ../../gcc/cp/decl2.c:2135 0x763a88 c_parse_final_cleanups() ../../gcc/cp/decl2.c:4611