Re: [patch] work around gcc-3.x inlining bugs

Kurt Garloff (
Thu, 6 Mar 2003 22:28:45 +0100

This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Andi,

On Thu, Mar 06, 2003 at 12:52:48PM +0100, Andi Kleen wrote:
> Andrew Morton <> writes:
> > This patch:
> [...]
> I experimented with -finline-limit=3D<huge number> to get it to obey inli=
> but that doesn't fully work. The only way to get it to work in 3.2 and 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.

Kurt Garloff <> Eindhoven, NL
GPG key: See mail header, key servers SuSE Labs
SuSE Linux AG, Nuernberg, DE SCSI, Security

Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)