From 3527e0720070a77ea35612df3293069e11be78c3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 27 May 2010 12:02:00 -0700 Subject: [PATCH] --- yaml --- r: 199344 b: refs/heads/master c: 1ba4f22c426ba04b00fd717318d50620c621a0e1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/cpufeature.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 63e573177203..a50edc2fe841 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 20413f27163fb1b8b806c0c219dc95eae67c633a +refs/heads/master: 1ba4f22c426ba04b00fd717318d50620c621a0e1 diff --git a/trunk/arch/x86/include/asm/cpufeature.h b/trunk/arch/x86/include/asm/cpufeature.h index dca9c545f44e..468145914389 100644 --- a/trunk/arch/x86/include/asm/cpufeature.h +++ b/trunk/arch/x86/include/asm/cpufeature.h @@ -332,6 +332,7 @@ static __always_inline __pure bool __static_cpu_has(u8 bit) #endif } +#if __GNUC__ >= 4 #define static_cpu_has(bit) \ ( \ __builtin_constant_p(boot_cpu_has(bit)) ? \ @@ -340,6 +341,12 @@ static __always_inline __pure bool __static_cpu_has(u8 bit) __static_cpu_has(bit) : \ boot_cpu_has(bit) \ ) +#else +/* + * gcc 3.x is too stupid to do the static test; fall back to dynamic. + */ +#define static_cpu_has(bit) boot_cpu_has(bit) +#endif #endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */