Re: huge gcc 4.1.{0,1} __weak problem

Linus Torvalds
2008-05-02T00:36:30Z

On Thu, 1 May 2008, Venki Pallipadi wrote:
>
> __weak function with single return statement, did not get inlined when called
> from say

Is it always about inlining? If so, can't we add a __noinline__ to the
declaration of __weak?

Something like this oneliner?

Linus

---
include/linux/compiler-gcc.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 5c8351b..4061fc7 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -41,7 +41,7 @@

#define __deprecated __attribute__((deprecated))
#define __packed __attribute__((packed))
-#define __weak __attribute__((weak))
+#define __weak __attribute__((weak)) noinline
#define __naked __attribute__((naked))
#define __noreturn __attribute__((noreturn))