lkml.org 
[lkml]   [2008]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] prepare kconfig inline optimization for all architectures


On Sun, 27 Apr 2008, Adrian Bunk wrote:

> On Sun, Apr 27, 2008 at 11:11:27AM -0700, Linus Torvalds wrote:
> >
> > For example, what's wrong with having "inline" on functions in .c files if
> > the author thinks they are small enough? He's likely right. Considering
> > past behaviour, he's quite often more right than the compiler.
> >...
>
> Ingo's commit in your tree just broke this assumption.

Note that our problem is too much inlining, not too little.

I'm actually happier with gcc not deciding to inline (despite having an
"inline") than I am with gcc deciding to inline (in violation of _not_
having an "inline").

So I don't disagree with Ingo's commit per se.

The only problem with not inlining is a historical one: exactly because
gcc _used_ to always do what people asked for, Linux has historically
treated "inline" as a "force_inline". And I was very unhappy when gcc
changed that, just because it broke historically good code.

In many ways, it might have been better if we had a "__may_inline" thing
to tell the compiler "you can inline this if you think it's worth it").
Both gcc (long ago) and Ingo (now) decided to just make plain "inline"
mean that, but with a pretty strong bias. It was wrong for gcc to do so,
imho, and it may have been wrong for this OPTIMIZE_INLINE thing too.
Linus


\
 
 \ /
  Last update: 2008-04-27 21:01    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site