Skip to contentSkip to conversation

Fix inlining size in gcc3

RFC PATCH New J.A. Magallon 1 participant 1 message Jun 18, 2003 Sparse checker

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Fix inlining size in gcc3

Hi.

This is one other patch collected from the list. It fixes cases when gcc3 can choose to inline or not inline some functions based on its size, even if are declared inline.

Credtis go to Andrew Morton <[email protected]>

include/linux/compiler.h renamed from include/linux/compiler.h~gcc3-inline-fix +7 -0
@@ -1,6 +1,13 @@
 #ifndef __LINUX_COMPILER_H
 #define __LINUX_COMPILER_H
 
+#if __GNUC__ >= 3
+#define inline		__inline__ __attribute__((always_inline))
+#define inline__	__inline__ __attribute__((always_inline))
+#define __inline	__inline__ __attribute__((always_inline))
+#define __inline__	__inline__ __attribute__((always_inline))
+#endif
+
 /* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
    a mechanism by which the user can annotate likely branch directions and
    expect the blocks to be reordered appropriately.  Define __builtin_expect
Signature · 4 lines
J.A. Magallon <[email protected]>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.21-jam1 (gcc 3.3 (Mandrake Linux 9.2 3.3-1mdk))