This is the mail archive of the
mailing list for the binutils project.
Re: An ia32 LOCK/XADD bug.
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: An ia32 LOCK/XADD bug.
- From: amodra at one dot net dot au
- Date: Thu, 17 May 2001 17:20:55 +0930
- Cc: GNU C Library <libc-alpha at sourceware dot cygnus dot com>, binutils at sourceware dot cygnus dot com
- References: <20010516125536.A6006@lucon.org> <20010517001556.B16213@lucon.org>
On Thu, May 17, 2001 at 12:15:56AM -0700, H . J . Lu wrote:
> It looks like
> lock xadd %edx,%edx
> is an illegal instruction on ia32. I cannot find anything in Intel
> reference manual to say you cannot have LOCK on insn where DST/SRC are
> reg or same. My questions are
> 1. How to write a correct exchange_and_add? Is exchange_and_add_1 ok?
I think you'll need to use "=&r" and "=&m" as output constraints.
> 2. If "lock xadd %edx,%edx" is really an illegal instruction on ia32,
> how should we fix gas to detect that?
IMO, we shouldn't. There are plenty of other instructions that we
can generate that are illegal.