Re: GCC 3.4 and broken inlining.

Andi Kleen
2004-07-11T08:26:37Z

On Sat, Jul 10, 2004 at 11:55:36PM -0700, Andrew Morton wrote:
> Andi Kleen <ak@muc.de> wrote:
> >
> > I guess it could be readded if the inlining heuristics were fixed,
> > but even in gcc 3.5 it still looks quite bleak.
>
> It's very simple. For use in the kernel we don't *want* any inlining
> heuristics. What we want is:
>
> a) If the programmer says "inline", then inline it.

The problem is that we have a lot of "stale" inlines. Inlines that
made sense a long time ago, but then people added a lot more code
to the function and it would be better to out line it again.
You should know, you seem to do this kind of out-lining most ...

For those it may even make sense to let the compiler chose.

>
> b) If the programmer didn't say "inline" then don't inline it.
>
> Surely it is not hard to add a new option to gcc to provide these semantics?

That option is -O2 -Dinline="__attribute__((always_inline))"
But for some reason it was turned off for 3.4/3.5.

-Andi