GIMPLE types merging in LTO compiler

Richard Guenther richard.guenther@gmail.com
Fri May 14 11:50:00 GMT 2010


On Fri, May 14, 2010 at 1:24 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> most of the remaining warnings issued by the LTO compiler on object files
> compiled from Ada are caused by a small flaw in the GIMPLE types merging
> process: it is done before symbols are merged so compatible types (typically
> domain types of arrays) whose distinguishing features depend on symbols
> (variable bounds for domain types of arrays) aren't recognized as such if the
> first type references one instance of the symbol (e.g. the "prevailing" one)
> and the second type references another instance of the same symbol.
>
> What's the best approach to addressing this?  Thanks in advance.

Ugh.  This presents a chicken-and-egg problem to symbol resolution
and type-merging.

To be clear, the issue is sth like

unit1
-----
int size;
int a[size];

unit2
------
extern int size;
extern a[size];

?  And you get the a's merged but a diagnostic about mismatched types?

One way to fix this would be to simply detect the situation and never
issue a diagnostic.  Another way would be to delay the diagnostics
until after all types and symbols are merged.  The natural place
for this would be lto_symtab_merge_cgraph_nodes () which already
is after type merging and still has all candidates available.

Richard.

> --
> Eric Botcazou
>



More information about the Gcc mailing list