http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52178

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-13 
13:29:38 UTC ---
Ok, the issue is that we end up with using a type streamed into the function
sections - those are assumed to not need participating in merging and thus
we never merge them, even canonically.  Instead they get assigned a "local"
alias-set TYPE_CANONICAL in lto_read_body:

      /* And fixup types we streamed locally.  */
...
              if (TYPE_P (t))
                {
                  gcc_assert (TYPE_CANONICAL (t) == NULL_TREE);
                  TYPE_CANONICAL (t) = TYPE_MAIN_VARIANT (t);

Now the question is why we consider the type "local" even though it is
referred to from "outside".  We decide that "indexability" in
tree_is_indexable which returns false for both copies of the type because
they are variably modified types (those cannot be possibly "global").
Still they are refered to globally.  I'm refering to
atree__atree_private_part__node_record___is_extension___XVN
(it doesn't have any TYPE_CONTEXT though, and its TYPE_SIZE is a constant).
Still variably_modified_type_p (t, NULL_TREE) returns true probaby because
DECL_QUALIFIER of one FIELD_DECL is

 <truth_not_expr 0x7ffff1bb7370
    type <boolean_type 0x7ffff5374a80 boolean asm_written public unsigned QI
        size <integer_cst 0x7ffff5249080 constant 8>
        unit size <integer_cst 0x7ffff52490a0 constant 1>
        align 8 symtab -180747728 alias set 2 canonical type 0x7ffff5374a80
precision 8 min <integer_cst 0x7ffff536b760 0> max <integer_cst 0x7ffff5249620
255>
        pointer_to_this <pointer_type 0x7ffff46e60a8>>

    arg 0 <nop_expr 0x7ffff1bb7398 type <boolean_type 0x7ffff5374a80 boolean>

        arg 0 <component_ref 0x7ffff1ac1e70 type <integer_type 0x7ffff4658348
boolean>

            arg 0 <placeholder_expr 0x7ffff1ba8eb8 type <record_type
0x7ffff46582a0 atree__atree_private_part__node_record>
               > arg 1 <field_decl 0x7ffff4656098 is_extension>>>>

the qualifiers of other FIELD_DECLs are a plain 'true' though (which looks
odd to me).

Reply via email to