On Wed, Jul 13, 2016 at 3:16 PM, Eric Botcazou <ebotca...@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