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

Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #2 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
Fixing this runs into failures of gcc.dg/debug/dwarf2/pr47939-4.c with what
looks like a problem with the DWARF debug output.

The problem (arising from the fix for PR 47939) is that the array of the
typedef was incorrectly constructed without a TYPE_MAIN_VARIANT being an array
of unqualified elements as it should be (though it seems some more recent
change resulted in this producing incorrect diagnostics, likely the support for
C++-style handling of arrays of qualified type).

Fixing the incorrect logic for determining first_non_attr_kind results in
failures of that DWARF test because the type ends up no longer being based on
the typedef.  A more complicated fix, however, as suggested in that PR, results
in a type properly based on the typedef, but the test still fails.  The type I
get (which results in debug info not referencing Harry_t, but looks correct to
me) is:

 <array_type 0x7ffff74e3e70
    type <record_type 0x7ffff74e3a80 Harry_t readonly type_0 SI
        size <integer_cst 0x7ffff73ceee8 constant 32>
        unit size <integer_cst 0x7ffff73cef00 constant 4>
        align 32 symtab -145814880 alias set -1 canonical type 0x7ffff74e39d8
        fields <field_decl 0x7ffff73f2da8 dummy type <integer_type
0x7ffff73d27e0 int>
            SI file t.c line 1 col 35 size <integer_cst 0x7ffff73ceee8 32> unit
size <integer_cst 0x7ffff73cef00 4>
            align 32 offset_align 128
            offset <integer_cst 0x7ffff73cecd8 constant 0>
            bit offset <integer_cst 0x7ffff73ced20 constant 0> context
<record_type 0x7ffff74e3738 _Harry>>>
    BLK
    size <integer_cst 0x7ffff73eb2d0 type <integer_type 0x7ffff73d22a0
bitsizetype> constant 320>
    unit size <integer_cst 0x7ffff74f1210 type <integer_type 0x7ffff73d21f8
sizetype> constant 40>
    align 32 symtab 0 alias set -1 canonical type 0x7ffff74e3f18
    domain <integer_type 0x7ffff74e3c78
        type <integer_type 0x7ffff73d21f8 sizetype public unsigned DI
            size <integer_cst 0x7ffff73ceca8 constant 64>
            unit size <integer_cst 0x7ffff73cecc0 constant 8>
            align 64 symtab -145814480 alias set -1 canonical type
0x7ffff73d21f8 precision 64 min <integer_cst 0x7ffff73cecd8 0> max <integer_cst
0x7ffff73e0480 18446744073709551615>>
        DI size <integer_cst 0x7ffff73ceca8 64> unit size <integer_cst
0x7ffff73cecc0 8>
        align 64 symtab 0 alias set -1 canonical type 0x7ffff74e3c78 precision
64 min <integer_cst 0x7ffff73cecd8 0> max <integer_cst 0x7ffff74f11b0 9>>>

Reply via email to