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

Michael Matz matz@suse.de
Fri Mar 19 14:55:00 GMT 2010


Hi,

On Fri, 19 Mar 2010, Frank Ch. Eigler wrote:

> On Fri, Mar 19, 2010 at 02:44:29PM +0100, Richard Guenther wrote:
> > [...]
> > I don't think this is a good approach.  
> 
> What would be a better technical measure?  If -flto is intended to be
> an optimization measure,

To me -Ox and -flto are orthogonal.

> what's the down-side of inferring something like -O2 in this case?  The 
> up-side is clear - one less flag to propagate into an unusual spot in a 
> makefile.

Well, what about all the other flags, some of them perhaps changing 
semantics (regparm e.g.)?  Simply adding an implicit -O2 for -flto doesn't 
releave the user from adding those to the link command as well, he still 
needs to be educated about that.  The choice of -O2 also seems arbitrary, 
why not -O3 or -O1?

I guess what I'm saying is, that there is no technical solution to this 
problem (or at least the proposed one isn't), except perhaps encoding the 
compile options (all of them) in some lto section, merging them in the 
lto step over all units (hoping to not find conflicting options) and use 
those.


Ciao,
Michael.



More information about the Gcc-patches mailing list