RFA: Set default optimization level to -O2 for -flto

Nick Clifton nickc@redhat.com
Fri Mar 19 15:03:00 GMT 2010


Hi Richard,

> I don't think this is a good approach.  Instead if you think documentation
> is unclear at the moment please consider clarifying it.

The documentation is OK.  I just made a stupid mistake in specifying -O3 
on the compiler command line but not on the linker command line.  (The 
testsuite harness that I was using has separate definitions for the 
compiler command line and the linker command line, located in separate 
portions of a configuration file).

My point is that I think that it would be easy for other users to make 
the same mistake and that gcc ought to be a little bit more helpful in 
such situations.  After all what is the point of enabling link time 
optimization if no optimizations are going to be performed ?  So, 
defaulting to -O2, or issuing a warning message, seems like a good thing 
to do.

Cheers
   Nick



More information about the Gcc-patches mailing list