From: H. Peter Anvin Date: Mon, 26 May 2008 20:36:53 +0000 (-0700) Subject: x86: string_32.h: workaround for broken gcc 4.0 X-Git-Tag: v2.6.27-rc1~1106^2~251^6~22 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a20d3ecf5c2a6435df2b756435b1eb1c657d45b;p=linux-2.6-omap-h63xx.git x86: string_32.h: workaround for broken gcc 4.0 gcc 4.0 fails to allocate %eax for the pattern operand in the rep store instructions used by memset; force it to do so by declaring a register variable. Signed-off-by: H. Peter Anvin --- diff --git a/include/asm-x86/string_32.h b/include/asm-x86/string_32.h index 8d0c593c441..193578cd1fd 100644 --- a/include/asm-x86/string_32.h +++ b/include/asm-x86/string_32.h @@ -267,11 +267,18 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern, asm volatile("rep ; stosl" \ x \ : "=&c" (d0), "=&D" (d1) \ - : "a" (pattern), "0" (count/4), "1" ((long)s) \ + : "a" (eax), "0" (count/4), "1" ((long)s) \ : "memory") { int d0, d1; +#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 + /* Workaround for broken gcc 4.0 */ + register unsigned long eax asm("%eax") = pattern; +#else + unsigned long eax = pattern; +#endif + switch (count % 4) { case 0: COMMON("");