This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]