This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/23242] Invalid %sil register chosen when dereferenced pointer used in inline asm with -O0
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Aug 2005 01:35:51 -0000
- Subject: [Bug inline-asm/23242] Invalid %sil register chosen when dereferenced pointer used in inline asm with -O0
- References: <20050805003204.23242.ianw@gelato.unsw.edu.au>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at physics dot uc dot edu 2005-08-05 01:35 -------
Subject: Re: New: Invalid %sil register chosen when dereferenced pointer used in inline asm with -O0
On Aug 4, 2005, at 8:32 PM, ianw at gelato dot unsw dot edu dot au
wrote:
> /* this one doesn't */
> __asm__ __volatile__("xchgb %0, %1"
> : "=r"(old), "=m"(*newp)
> : "0"(0xff), "m"(*newp) : "memory");
This is not a bug.
r is selecting %sil which is a valid register for x86_64.
"r" is assuming that it is a full size register.
Use "Q" instead.
-- Pinski
PS The reason why I am CC you instead of writing this into bugzilla is
because
bugzilla seems dead.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23242