RFA: Warn when running LTO compiler without any optimization level set

Diego Novillo dnovillo@google.com
Fri Apr 9 15:33:00 GMT 2010


On Fri, Apr 9, 2010 at 11:19, Nick Clifton <nickc@redhat.com> wrote:

>  Running the LTO compiler without enabling any optimizations is not
>  very useful, but it can happen if the user forgets to include a -O<n>
>  setting on the linker command line.  (Or as happened to me, a
>  testsuite harness has separate settings for the compiler and linker
>  command lines and although -flto has been added to both, -03 was only
>  added to the compiler command line).

That's not the intent of LTO, actually.  In theory, one should be able
to emit bytecode at any optimization level and then decide what
optimizations to apply at link time.  IOW, the gimple bytecode emitted
should not change.

This way, you could package up all the TUs in a generic bytecode
library and then decide how to optimize it at deployment time:

The fact that this is currently not possible, is an indication of
implementation bugs.  At most we could sorry() for now when we notice
this.


Diego.



More information about the Gcc-patches mailing list