This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Fix miscompilation of gnat1 in LTO bootstrap
- 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>
- Date: Tue, 7 Oct 2014 16:49:39 +0200
- Subject: Re: [patch] Fix miscompilation of gnat1 in LTO bootstrap
- Authentication-results: sourceware.org; auth=none
- References: <1553466 dot Fmh6GVef6h at polaris> <CAFiYyc3Dnd7FjMPoG6O35-1gfYKrnRcxjt+op1i65cfCG-s8gA at mail dot gmail dot com> <1860810 dot 1P47kgm7eF at polaris>
On Tue, Oct 7, 2014 at 10:04 AM, Eric Botcazou <firstname.lastname@example.org> wrote:
>> Testcase? I think it would be better to handle this in the canonical type
>> merging code in lto.c - or how does it end up working without LTO? That is,
>> what does the Ada frontend do to make sure get_alias_set handles this
> It manages the alias sets, see gcc-interface/utils.c:relate_alias_sets.
I can't see how this can work with LTO. We need a middle-end way
to represent the alias relation of those types. At least I can't see how
your simple patch covers all cases here?
With LTO we preserve TYPE_ALIAS_SET == 0, so another way to
fix this (and which I'd like more) is to do your patch in the Ada frontend,
that is, use alias-set zero for all types you relate if flag_lto.
Another way is to make LTO canonical type merging handle the
case of type_contains_placeholder_p "better", that is by treating
two types with those equivalent more easily. For arrays this simply
means hashing and comparing non-constant TYPE_DOMAIN the
same / as equal. There is already some code handling PLACEHODER_EXPR
special, but it doesn't seem to be enough (why in this case)?
> Eric Botcazou