Enable autoinlining for size at O2

Jan Hubicka jh@suse.cz
Tue Sep 4 16:53:00 GMT 2007


> On 04/09/07, Andrew Pinski <pinskia@gmail.com> wrote:
> > On 9/4/07, Manuel LĂłpez-IbĂĄ?ez <lopezibanez@gmail.com> wrote:
> > >
> > > If this works as advertised, why not enable it with -Os also?
> >
> > because it is.  -Os is -O2 minus a couple of things and plus a couple others.
> >
> 
> Reading the doc excerpt I quoted, it is not obvious whether the option
> is enabled at -Os. In many other options we mention explicitly Os,
> 
>       -foptimize-sibling-calls
>            Optimize sibling and tail recursive calls.
> 
>            Enabled at levels -O2, -O3, -Os.
> 
> I am just asking for

-Os behaves slightly differently -O2 will inline large function when
explicitly asked for it via inline keyword, -Os won't.  But perhaps it
would make more sense if -finline-small-functions was enabled at both
(at the moment that is no way to disable the inlining of those functions
at -Os).  I will give it a try.

Honza
> 
> @item -finline-small-functions
> @opindex finline-small-functions
> Integrate functions into their callers when their body is smaller than expected
> function call code (so overall size of program gets smaller).  The compiler
> heuristically decides which functions are simple enough to be worth integrating
> in this way.
> 
> - Enabled at level @option{-O2}.
> + Enabled at level @option{-O2}, @option{-Os}.
> 
> Sorry for being too picky,
> 
> Manuel.



More information about the Gcc-patches mailing list