Re: egcs 1.0.1 miscompiles Linux 2.0.33

Richard Henderson (rth@dot.cygnus.com)
Sun, 1 Mar 1998 20:59:34 -0800


On Sun, Mar 01, 1998 at 01:59:56PM -0800, Linus Torvalds wrote:
> #define restore_flags(restore_value) \
> asm("rdwrexception %0\n\t" \
> "andl $0xfffffffe,%0\n\t" \
> "orl %1,%0\n\t" \
> "rdwrexception %0" \
> : /* no outputs */ \
> :"c" (0xffffffff), \
> "g" (restore_value) \
> :"cx")
>
> Now, how should I re-write this to avoid the clobber?
>
> I could use "=c" and "0" to tell gcc that %ecx is a read-write thing and
> will change. But that doesn't tell gcc that it mustn't use %ecx for the
> value in "restore_value"

You should use "=&c" to say that the output should use a new register.
That output will be shared with no other input except an explicit "0".

r~

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu