Re: Status of CONFIG_FORCED_INLINING?

Adrian Bunk
2007-05-24T22:42:12Z

On Thu, May 24, 2007 at 11:32:07AM -0700, Roland Dreier wrote:
> > The problem is that inline functions in headers are intended to be
> > called from different C files.
> >
> > gcc might not inline it in the C files where it is called more than
> > once.
> >
> > But it will always inline it if it's called only once.
> >
> > One of both will be suboptimal, but from gcc's perspective it was
> > optimal.
>
> Yes, we could probably get huge benefits from --combine and/or
> -fwhole-program to let gcc see more than one file at a time.
>
> But I still don't see the issue with having gcc do the best it can on
> each file it compiles. If you force the inlining, then that means
> that on files where not inlining was better, you've forced gcc to
> generate worse code. (I don't see how not inlining could be locally
> better on a single file but globally worse, even though it generated
> better code on each compiled file)

Can you give examples where for one function it differs between
different C files whether it should be inlined or not?

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