It's not even a workaround for a bug. Function inlining has nothing to
do with the problem. The following testcase (gcc.dg/clobbers.c in the egcs
testsuite) demonstrates that:
int main ()
{
int i;
__asm__ ("movl $1,%0\n\txorl %%eax,%%eax" : "=r" (i) : : "eax");
if (i != 1)
abort ();
__asm__ ("movl $1,%0\n\txorl %%ebx,%%ebx" : "=r" (i) : : "ebx");
if (i != 1)
abort ();
__asm__ ("movl $1,%0\n\txorl %%ecx,%%ecx" : "=r" (i) : : "ecx");
if (i != 1)
abort ();
__asm__ ("movl $1,%0\n\txorl %%edx,%%edx" : "=r" (i) : : "edx");
if (i != 1)
abort ();
__asm__ ("movl $1,%0\n\txorl %%esi,%%esi" : "=r" (i) : : "esi");
if (i != 1)
abort ();
__asm__ ("movl $1,%0\n\txorl %%edi,%%edi" : "=r" (i) : : "edi");
if (i != 1)
abort ();
return 0;
}
It might be possible to construct a workaround for egcs-1.1, but it would most
likely be rather ugly, and it doesn't help people who use gcc-2.7.2 or
egcs-1.0.3. The simplest workaround is to avoid using clobbers on the x86.
Bernd
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/