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

Anton Blanchard <anton at samba dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anton at samba dot org

--- Comment #12 from Anton Blanchard <anton at samba dot org> ---
I hit this when building MariaDB. Reduced testcase:


typedef struct bn_gencb_st BN_GENCB;

struct bn_gencb_st {
        void *arg;
        union {
                int (*cb_2)(int, int, BN_GENCB *);
        };
};


g++ -O0 -g -c testcase.i
testcase.i:5:15: error: TYPE_CANONICAL is not compatible
         union {
               ^
 <record_type 0x3fff76fbc630 bn_gencb_st type_5 VOID
    align 8 symtab 1995243680 alias set -1 canonical type 0x3fff76fbc630
    fields <field_decl 0x3fff76eb49a0 arg
        type <pointer_type 0x3fff76e01110 type <void_type 0x3fff76e00fc0 void>
            public unsigned DI
            size <integer_cst 0x3fff76db1470 constant 64>
            unit size <integer_cst 0x3fff76db1488 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x3fff76e01110
            pointer_to_this <pointer_type 0x3fff76e04cc8>>
        decl_3 VOID file testcase.i line 4 col 15
        align 1 offset_align 1 context <record_type 0x3fff76fbc630 bn_gencb_st>
        chain <type_decl 0x3fff76eb4908 bn_gencb_st type <record_type
0x3fff76fbc8d0 bn_gencb_st>
            nonlocal decl_4 VOID file testcase.i line 3 col 20
            align 1 context <record_type 0x3fff76fbc630 bn_gencb_st> result
<record_type 0x3fff76fbc630 bn_gencb_st>
            chain <type_decl 0x3fff76eb4ad0 ._0>>> context
<translation_unit_decl 0x3fff79680078 D.1>
    full-name "struct bn_gencb_st"
    n_parents=0 use_template=0 interface-unknown
    pointer_to_this <pointer_type 0x3fff76fbcb70> chain <type_decl
0x3fff76eb47d8 bn_gencb_st>>
 <record_type 0x3fff76fbc6d8 BN_GENCB type_5 VOID
    align 8 symtab 1995243600 alias set -1 canonical type 0x3fff76fbc630
context <translation_unit_decl 0x3fff79680078 D.1>
    full-name "BN_GENCB"
    n_parents=0 use_template=0 interface-unknown
    pointer_to_this <pointer_type 0x3fff76fbcac8> chain <type_decl
0x3fff76eb47d8 bn_gencb_st>>
testcase.i:5:15: internal compiler error: verify_type failed
0x10dd6617 verify_type(tree_node const*)
        ../../gcc/gcc/tree.c:13570
0x1067fc67 gen_type_die_with_usage
        ../../gcc/gcc/dwarf2out.c:20685
0x10680887 gen_type_die_with_usage
        ../../gcc/gcc/dwarf2out.c:20783
0x10681d97 gen_type_die
        ../../gcc/gcc/dwarf2out.c:20879
0x1067f3d3 gen_formal_types_die
        ../../gcc/gcc/dwarf2out.c:18225
0x1067f91b gen_subroutine_type_die
        ../../gcc/gcc/dwarf2out.c:20505
0x1068046f gen_type_die_with_usage
        ../../gcc/gcc/dwarf2out.c:20812
0x10680887 gen_type_die_with_usage
        ../../gcc/gcc/dwarf2out.c:20783
0x10681d97 gen_type_die
        ../../gcc/gcc/dwarf2out.c:20879
0x1067538f gen_decl_die
        ../../gcc/gcc/dwarf2out.c:21519
0x106786bb gen_member_die
        ../../gcc/gcc/dwarf2out.c:20356
0x106786bb gen_struct_or_union_type_die
        ../../gcc/gcc/dwarf2out.c:20461
0x106786bb gen_tagged_type_die
        ../../gcc/gcc/dwarf2out.c:20662
0x1068079f gen_type_die_with_usage
        ../../gcc/gcc/dwarf2out.c:20824
0x10681d97 gen_type_die
        ../../gcc/gcc/dwarf2out.c:20879
0x10675b9b gen_decl_die
        ../../gcc/gcc/dwarf2out.c:21465
0x1067681f dwarf2out_decl
        ../../gcc/gcc/dwarf2out.c:21915
0x10676c77 dwarf2out_type_decl
        ../../gcc/gcc/dwarf2out.c:21625
0x1098065f rest_of_type_compilation(tree_node*, int)
        ../../gcc/gcc/passes.c:336
0x102c2223 finish_struct_1(tree_node*)
        ../../gcc/gcc/cp/class.c:6747

Reply via email to