lkml.org 
[lkml]   [2003]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] work around gcc-3.x inlining bugs
Hi Andi,

On Thu, Mar 06, 2003 at 12:52:48PM +0100, Andi Kleen wrote:
> Andrew Morton <akpm@digeo.com> writes:
>
> > This patch:
> [...]
>
> I experimented with -finline-limit=<huge number> to get it to obey inline,
> but that doesn't fully work. The only way to get it to work in 3.2 and 3.3
> is to specify various long and weird --param arguments. In 3.0 the only
> way is to change the values in the compiler source and recompile.

--param max-inline-insns-single
The fact that this parameter does not get initialized by using
-finline-limit is a bug. A fix for this has already gone into CVS HEAD
(3.4) and is pending for 3.3.

[... ]
> I think it is the right thing to do. In kernel land when we say inline
> we mean inline. Don't expect the compiler to second guess that,
> especially since it doesn't seem to be very good at that.

The compiler solely judges by the size of the function to be inlined,
no magic involved.
There are two reasons, why this may not be what you expect:
- The allowable size can get smaller if in the function from that
you're calling and the one above and ... were already inlined.
At some moment this recursive inlining has to be stopped to
not results in excessive compile time resource requirements
- When calculating the size of a function, the compiler counts
tree tokens, each estimated to yield 10 RTL instructions.
It does unfortunately not take into account code that will
be eliminated by optimization (constant propagation, dead
code elimination, ...) nor does it have a very good idea
about the size of inline assembly.

Regards,
--
Kurt Garloff <garloff@suse.de> Eindhoven, NL
GPG key: See mail header, key servers SuSE Labs
SuSE Linux AG, Nuernberg, DE SCSI, Security
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.036 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site