lkml.org 
[lkml]   [2004]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
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:
>...
> > > 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.


It's a bug in compiler-gcc3.h, and I already sent the patch below in
this thread.

I'm currently sending fixes for compile errors this causes with gcc 3.4
(I've forgotten the exact number, but there were compile errors in at
about 30 files in a full i386 compile).


<-- snip -->


[patch] #define inline as __attribute__((always_inline)) also for gcc >= 3.4

Rationale:
- if gcc 3.4 can't inline a function marked as "inline" that's a
strong hint that further investigation is required
- I strongly prefer a compile error over a potential runtime problem


Signed-off-by: Adrian Bunk <bunk@fs.tum.de>

--- linux-2.6.7-mm6-full-gcc3.4/include/linux/compiler-gcc3.h.old 2004-07-08 23:40:27.000000000 +0200
+++ linux-2.6.7-mm6-full-gcc3.4/include/linux/compiler-gcc3.h 2004-07-08 23:40:37.000000000 +0200
@@ -3,7 +3,7 @@
/* These definitions are for GCC v3.x. */
#include <linux/compiler-gcc.h>

-#if __GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 4
+#if __GNUC_MINOR__ >= 1
# define inline __inline__ __attribute__((always_inline))
# define __inline__ __inline__ __attribute__((always_inline))
# define __inline __inline__ __attribute__((always_inline))
-
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    [W:0.084 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site