On Fri, May 25, 2012 at 12:27 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
> This is a follow-up to PR lto/52178: there are more "type mismatch in 
> component
> reference" issues related to variably_modified_type_p when you try to build
> the gnattools with -flto:
>
>  1. Instances of a record type with fixed size at top level aren't merged if
>     it has a field with self-referential size because variably_modified_type_p
>     returns true for the latter.  I think the fix is straightforward: return
>     false for the special PLACEHOLDER_EXPR marker that is set in this case by
>     free_lang_data_in_one_sizepos.
>
>  2. Twin variably_modified_type_p qualified union types that belong to two
>     different functions may appear in the same COMPONENT_REF expression,
>     leading to a type mismatch.  This occurs after a variably_modified_type_p
>     qualified union in the first function is remapped during the versioning
>     done by ipa-split to create the second function, and remapping overwrites
>     the type of a FIELD_DECL of the original type.
>
> Proposed patch attached, bootstrapped/regtested on x86_64-suse-linux and LTO
> bootstrapped on the same platform.  #1 is a regression from 4.6 and #2 has
> been exposed by ipa-split (although it's probably older) so I'd like to put
> this on the 4.7 branch as well.

Ok.  Please make sure to verify LTO bootstrap on the branch still
works after this.

Thanks,
Richard.

>
> 2012-05-25  Eric Botcazou  <ebotca...@adacore.com>
>
>        PR lto/52178
>        * tree-inline.c (remap_gimple_op_r): Fix handling of FIELD_DECL.
>        * tree.c (RETURN_TRUE_IF_VAR): Do not return true for PLACEHOLDER_EXPR.
>
>
> --
> Eric Botcazou

Reply via email to