lto and compile flag associations

Richard Guenther richard.guenther@gmail.com
Mon May 17 12:50:00 GMT 2010


On Mon, May 17, 2010 at 2:46 PM, Diego Novillo <dnovillo@google.com> wrote:
> On Mon, May 17, 2010 at 08:39, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>
>> Instead of trying to record switches that way we should instead
>> save the final settings of relevant flag_* values somewhere and
>> simply complain on mismatches.
>
> What would be the difference?  The flags are reapplied as if they had
> been given on the command line.

For example the C++ frontend sets flag_exceptions to 1 but the
command-line does not contain -fexceptions.  Or the Fortran
frontend might set flag_no_signed_zeros but the command-line
does not contain -fno-signed-zeros.  Similar the Java frontend
sets flag_wrapv but it's not on the command-line either.

Looking at the command-line for exactly those options we try
to match (as they change semantics) does not work reliably
because of that issue.

And for those that would work (optimization options) it doesn't
really matter (and we don't care at the moment).

The only thing where it might actually work sort-of is for
target options, but even that's fragile as we don't merge options
but take those of the first (or last) TU (so if one unit selects
-msse2 and one -mavx we don't necessarily get -mavx for the
link step).

Richard.

>
> Diego.
>



More information about the Gcc mailing list