This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs 1.0.1 miscompiles Linux 2.0.33
- To: Linus Torvalds <torvalds at transmeta dot com>
- Subject: Re: egcs 1.0.1 miscompiles Linux 2.0.33
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sun, 1 Mar 1998 20:59:34 -0800
- Cc: law at cygnus dot com, Gabriel Paubert <paubert at iram dot es>, Andi Kleen <ak at muc dot de>, Thomas König <Thomas dot Koenig at ciw dot uni-karlsruhe dot de>, linux-kernel at vger dot rutgers dot edu, egcs at cygnus dot com
- References: <3643.888784179@hurl.cygnus.com> <Pine.LNX.3.95.980301134300.9189B-100000@penguin.transmeta.com>
- Reply-To: Richard Henderson <rth at cygnus dot com>
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~