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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|ipa                         |lto

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Changing component to LTO.
This fails on the sanity check:
5295              gcc_assert (TYPE_CANONICAL (t2) != t2
5296                          && TYPE_CANONICAL (t2) == TYPE_CANONICAL
(TREE_TYPE (t)));

which is supposed to check that TYPE_CANONICAL of newly created pointer to t2
points to right place.

In this case t2 is:
 <record_type 0x7ffff7234930 S atomic packed type_0 VOID
    align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff7234348 context <translation_unit_decl 0x7ffff70f4ca8 t.c>
    pointer_to_this <pointer_type 0x7ffff72349d8>>

which is incomplete version of its TYPE_CANONICAL:
(gdb) p debug_tree (t2->type_common.canonical)
 <record_type 0x7ffff7234348 S atomic packed type_0 SI
    size <integer_cst 0x7ffff70e7ed0 type <integer_type 0x7ffff71000a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x7ffff70e7ee8 type <integer_type 0x7ffff7100000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff7234348
    fields <field_decl 0x7ffff710f2f8 x
        type <integer_type 0x7ffff71005e8 int sizes-gimplified public SI size
<integer_cst 0x7ffff70e7ed0 32> unit-size <integer_cst 0x7ffff70e7ee8 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set 2 canonical-type
0x7ffff71005e8 precision:32 min <integer_cst 0x7ffff70e7e88 -2147483648> max
<integer_cst 0x7ffff70e7ea0 2147483647>
            pointer_to_this <pointer_type 0x7ffff71089d8>>
        packed SI t.c:1:16 size <integer_cst 0x7ffff70e7ed0 32> unit-size
<integer_cst 0x7ffff70e7ee8 4>
        align:8 warn_if_not_align:0 offset_align 128
        offset <integer_cst 0x7ffff70e7cc0 constant 0>
        bit-offset <integer_cst 0x7ffff70e7d08 constant 0> context <record_type
0x7ffff720fd20 S>> context <translation_unit_decl 0x7ffff70f4ca8 t.c>
    pointer_to_this <pointer_type 0x7ffff72343f0>>

TREE_TYPE (t) is:
(gdb) p debug_tree (t->typed.type)
 <record_type 0x7ffff720fdc8 S atomic packed type_0 SI
    size <integer_cst 0x7ffff70e7ed0 type <integer_type 0x7ffff71000a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x7ffff70e7ee8 type <integer_type 0x7ffff7100000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff720fdc8
    fields <field_decl 0x7ffff710f2f8 x
        type <integer_type 0x7ffff71005e8 int sizes-gimplified public SI size
<integer_cst 0x7ffff70e7ed0 32> unit-size <integer_cst 0x7ffff70e7ee8 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set 2 canonical-type
0x7ffff71005e8 precision:32 min <integer_cst 0x7ffff70e7e88 -2147483648> max
<integer_cst 0x7ffff70e7ea0 2147483647>
            pointer_to_this <pointer_type 0x7ffff71089d8>>
        packed SI t.c:1:16 size <integer_cst 0x7ffff70e7ed0 32> unit-size
<integer_cst 0x7ffff70e7ee8 4>
        align:8 warn_if_not_align:0 offset_align 128
        offset <integer_cst 0x7ffff70e7cc0 constant 0>
        bit-offset <integer_cst 0x7ffff70e7d08 constant 0> context <record_type
0x7ffff720fd20 S>> context <translation_unit_decl 0x7ffff70f4ca8 t.c>
    pointer_to_this <pointer_type 0x7ffff7234000>>

and TYPE_CANONICAL (TREE_TYPE (t)) is:
 <record_type 0x7ffff720fdc8 S atomic packed type_0 SI
    size <integer_cst 0x7ffff70e7ed0 type <integer_type 0x7ffff71000a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x7ffff70e7ee8 type <integer_type 0x7ffff7100000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff720fdc8
    fields <field_decl 0x7ffff710f2f8 x
        type <integer_type 0x7ffff71005e8 int sizes-gimplified public SI size
<integer_cst 0x7ffff70e7ed0 32> unit-size <integer_cst 0x7ffff70e7ee8 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set 2 canonical-type
0x7ffff71005e8 precision:32 min <integer_cst 0x7ffff70e7e88 -2147483648> max
<integer_cst 0x7ffff70e7ea0 2147483647>
            pointer_to_this <pointer_type 0x7ffff71089d8>>
        packed SI t.c:1:16 size <integer_cst 0x7ffff70e7ed0 32> unit-size
<integer_cst 0x7ffff70e7ee8 4>
        align:8 warn_if_not_align:0 offset_align 128
        offset <integer_cst 0x7ffff70e7cc0 constant 0>
        bit-offset <integer_cst 0x7ffff70e7d08 constant 0> context <record_type
0x7ffff720fd20 S>> context <translation_unit_decl 0x7ffff70f4ca8 t.c>
    pointer_to_this <pointer_type 0x7ffff7234000>>

So we have two versions of the packed structure, I am not sure why?

Reply via email to