lkml.org 
[lkml]   [2004]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Date
From
SubjectRe: GCC 3.4 and broken inlining.
On Sun, Jul 11, 2004 at 01:32:18AM -0700, Andrew Morton wrote:
> Andi Kleen <ak@muc.de> wrote:
> >
> > 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 ...
>
> We've already fixed zillions of those, and patches are accepted. I think
> someone wrote a tool to hunt those functions down, too.

Ok, we'll see. Fixing that would be good of course.

> > >
> > > 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.
> >
>
> Please tell me that was just a bug, and it will be fixed very soon.

compiler-gcc3.h:

#if __GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 4
# define inline __inline__ __attribute__((always_inline))
# define __inline__ __inline__ __attribute__((always_inline))
# define __inline __inline__ __attribute__((always_inline))
#endif

iirc the problem was that gcc errors now out when a function
marked like this cannot be inlined for some reason.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [from the cache]
©2003-2011 Jasper Spaans