Re: cpuid_eax damages registers (2.4.7pre7)

From: H. Peter Anvin (hpa@zytor.com)
Date: Sat Jul 21 2001 - 23:27:53 EST


Followup to: <20010721170018.C3676@twiddle.net>
By author: Richard Henderson <rth@twiddle.net>
In newsgroup: linux.dev.kernel
>
> On Wed, Jul 18, 2001 at 03:04:20PM -0700, Linus Torvalds wrote:
> > Can you verify with this alternate patch instead?
>
> I take it you've found something that happens to work with egcs 1.1?
>
> At a glance the bug appears to be the one that caused
> gcc/testsuite/gcc.dg/clobbers.c to be written. That one
> is a fundamental flaw in reload that caused it to be
> largely rewritten for gcc 2.95.
>
> In other words, you may not be able to find a workaround
> for egcs 1.1 that works for all cases. Using an alternative
> that writes all of eax/ebx/ecx/edx to memory is probably
> safer if none of the uses of cpuid are performance-critical.
>

Either making the asms "volatile" seems to work, as does leaving the
unused arguments as clobbers rather than output operands. If either
doesn't work with later versions, then later versions would have their
own bugs.

        -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:15 EST