This is the mail archive of the gcc@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: GCC -On optimization passes: flag and doc issues


On Tue, Apr 17, 2007 at 03:44:36PM -0700, Ian Lance Taylor wrote:
> The relevant code is in opts.c:
> 
>   if (optimize_size)
>     {
>       /* Inlining of very small functions usually reduces total size.  */
>       set_param_value ("max-inline-insns-single", 5);
>       set_param_value ("max-inline-insns-auto", 5);
>       flag_inline_functions = 1;
> ...
> Inlining has changed considerably since then, and it is possible that
> these parameter values are no longer appropriate.  The reports at the
> time indicate space savings.

Maybe there's a problem in setting the threshold in terms of
only the size of the function.  Inlining the function saves space if
the function itself is no longer than the code to pass the arguments and
do the call.  But the threshold is expressed in terms of only the
number of instructions.  For a zero-argument function, inlining a
5-instruction function will increase the code size, but if there are
3-4 arguments, the reverse is likely to be the case.

Perhaps the number of arguments should be taken into account as well.


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