Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] ppc64: Fix issue with gcc 4.0 compiled kernels

I recently had a BUG_ON() go off spuriously on a gcc 4.0 compiled kernel.
It turns out gcc-4.0 was removing a sign extension while earlier gcc
versions would not. Thinking this to be a compiler bug, I submitted a
report:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23422

It turns out we need to cast the input in order to tell gcc to sign extend
it.

Thanks to Andrew Pinski for his help on this bug.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Anton Blanchard and committed by
Linus Torvalds
32818c2e 212d6d22

+4 -3
+4 -3
include/asm-ppc64/bug.h
··· 43 43 ".section __bug_table,\"a\"\n\t" \ 44 44 " .llong 1b,%1,%2,%3\n" \ 45 45 ".previous" \ 46 - : : "r" (x), "i" (__LINE__), "i" (__FILE__), \ 47 - "i" (__FUNCTION__)); \ 46 + : : "r" ((long long)(x)), "i" (__LINE__), \ 47 + "i" (__FILE__), "i" (__FUNCTION__)); \ 48 48 } while (0) 49 49 50 50 #define WARN_ON(x) do { \ ··· 53 53 ".section __bug_table,\"a\"\n\t" \ 54 54 " .llong 1b,%1,%2,%3\n" \ 55 55 ".previous" \ 56 - : : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP), \ 56 + : : "r" ((long long)(x)), \ 57 + "i" (__LINE__ + BUG_WARNING_TRAP), \ 57 58 "i" (__FILE__), "i" (__FUNCTION__)); \ 58 59 } while (0) 59 60