diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-26 16:36:53 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-26 16:36:53 -0400 |
commit | 1a20d3ecf5c2a6435df2b756435b1eb1c657d45b (patch) | |
tree | 41a6bd0fce8a82fe199471a66aa9a84895544325 /include/asm-x86/string_32.h | |
parent | 4b6011bc6ec71660859139ac8d28b7d0badd681c (diff) |
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 <hpa@zytor.com>
Diffstat (limited to 'include/asm-x86/string_32.h')
-rw-r--r-- | include/asm-x86/string_32.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/asm-x86/string_32.h b/include/asm-x86/string_32.h index 8d0c593c4413..193578cd1fd9 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, | |||
267 | asm volatile("rep ; stosl" \ | 267 | asm volatile("rep ; stosl" \ |
268 | x \ | 268 | x \ |
269 | : "=&c" (d0), "=&D" (d1) \ | 269 | : "=&c" (d0), "=&D" (d1) \ |
270 | : "a" (pattern), "0" (count/4), "1" ((long)s) \ | 270 | : "a" (eax), "0" (count/4), "1" ((long)s) \ |
271 | : "memory") | 271 | : "memory") |
272 | 272 | ||
273 | { | 273 | { |
274 | int d0, d1; | 274 | int d0, d1; |
275 | #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 | ||
276 | /* Workaround for broken gcc 4.0 */ | ||
277 | register unsigned long eax asm("%eax") = pattern; | ||
278 | #else | ||
279 | unsigned long eax = pattern; | ||
280 | #endif | ||
281 | |||
275 | switch (count % 4) { | 282 | switch (count % 4) { |
276 | case 0: | 283 | case 0: |
277 | COMMON(""); | 284 | COMMON(""); |