This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Warn when running LTO compiler without any optimization level set
- From: Diego Novillo <dnovillo at google dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Apr 2010 11:33:26 -0400
- Subject: Re: RFA: Warn when running LTO compiler without any optimization level set
- References: <m339z4hcwb.fsf@redhat.com>
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.