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

From: Linus Torvalds
Date: Thu May 01 2008 - 20:36:31 EST




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))

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