I'd certainly like to see the one-liner fix if someone has it. I can provide
a program that fails with gcc-2.7.2 and 2.8.0 (and probably every gcc version
that was ever released):
---- begin program
int main ()
{
int foo;
__asm__ ("xorl %%eax,%%eax" : "=r" (foo) : "0" (1) : "eax");
if (foo == 0)
abort ();
__asm__ ("xorl %%ebx,%%ebx" : "=r" (foo) : "0" (1) : "ebx");
if (foo == 0)
abort ();
__asm__ ("xorl %%ecx,%%ecx" : "=r" (foo) : "0" (1) : "ecx");
if (foo == 0)
abort ();
__asm__ ("xorl %%edx,%%edx" : "=r" (foo) : "0" (1) : "edx");
if (foo == 0)
abort ();
__asm__ ("xorl %%edi,%%edi" : "=r" (foo) : "0" (1) : "edi");
if (foo == 0)
abort ();
__asm__ ("xorl %%esi,%%esi" : "=r" (foo) : "0" (1) : "esi");
if (foo == 0)
abort ();
__asm__ ("xorl %%ebp,%%ebp" : "=r" (foo) : "0" (1) : "ebp");
if (foo == 0)
abort ();
return 0;
}
---- end program
One of the assembler statements will use the clobbered register for the output
constraint. (You obviously need to compile with -fomit-frame-pointer or the
program does not even make sense.)
The lesson to be learned from this: asm statements do not work as advertised
in the GCC documentation, at least not on the i386. The compiler _will_
ignore the specified clobbers if it can't find a register. And I have strong
doubts that this can be fixed with a one-line patch.
So, it would be sensible to have workarounds for this in the kernel. GCC 2.8
has an immense number of bug fixes over 2.7.2, and telling people to use the
old compiler is Wrong, IMHO. Just run the c-torture test or the egcs
testsuite on 2.7.2 and see what you get.
Bernd
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu