This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix type merging deficiency during WPA
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Thu, 14 Jul 2016 14:05:39 +0200
- Subject: Re: [patch] Fix type merging deficiency during WPA
- Authentication-results: sourceware.org; auth=none
- References: <1644035.nvA1iejZSU@polaris> <1984635.2VDvgg1PtU@polaris> <CAFiYyc3dNUpnvarh+UHrES224TxWN-dQ1gN=Zqajd-mvcjucfA@mail.gmail.com> <3173725.9mBKl3zftc@polaris>
On Wed, Jul 13, 2016 at 3:16 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> As tree merging really replaces trees it has to error on the side of not
>> merging while canonical type merging has to error on the side of "merging"
>> to make types alias.
>
> OK, then the former won't be sufficient for Ada, there are known cases where
> producers and clients of a package cannot see the exact same tree for a type,
> so we definitely need optimistic merging here.
Yeah, as said such optimistic merging would need to happen during canoncial type
merging for example by completely ignoring TYPE_DOMAIN or DECL_FIELD_OFFSET ...
(a non-constant in one unit may be the same as a constant in another...).
But merging more trees is also good - though in this case I tend to
favor the approach
to have symbols merged first and only the prevailing 'tree' survive.
>> Btw, for the LTO_SET_PREVAIL can you introduce a LTO_SET_PREVAIL_EXPR
>> and use that for the fields that possibly can be expressions plus simply use
>> walk_tree for those (in case they are EXPR_P)? Please split that part out
>> as well.
>
> Yes, I can do that.
Thanks.
> --
> Eric Botcazou