Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers

Adrian Bunk
2005-12-30T20:59:15Z

On Fri, Dec 30, 2005 at 03:28:00PM +0000, Alan Cox wrote:
> On Mer, 2005-12-28 at 20:11 -0800, Andrew Morton wrote:
> > If no-forced-inlining makes the kernel smaller then we probably have (yet
> > more) incorrect inlining. We should hunt those down and fix them. We did
> > quite a lot of this in 2.5.x/2.6.early. Didn't someone have a script which
> > would identify which functions are a candidate for uninlining?
>
> There is a tool that does this quite well. Its called "gcc" ;)
>
> More seriously we need to seperate "things Andrew thinks are good inline
> candidates" and "things that *must* be inlined". That allows 'build for
> size' to do the equivalent of "-Dplease_inline" and the other build to
> do "-Dplease_inline=inline". Gcc's inliner isn't aware of things cross
> module so isn't going to make all the decisions right, but will make the
> tedious local decisions.
>...

I'm not getting the point:

Shouldn't "static" versus not "static" already give gcc everything it
needs for making the decision?

If stuff is cross-module (more exactly: cross-objects) it's not static
and I doubt there are many (if any) cases of non-static code we want
inline'd when used inside the file it's in.

> Alan

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed