This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RegRegname vs. Explicit Local Register Variables ...
- From: Magnus Fromreide <magfr at lysator dot liu dot se>
- To: Matthijs van Duin <matthijs at cds dot nl>
- Cc: Craig Newell <craign at ieee dot org>, <gcc at gcc dot gnu dot org>
- Date: Fri, 24 May 2002 12:31:38 +0200 (MEST)
- Subject: Re: RegRegname vs. Explicit Local Register Variables ...
On Fri, 24 May 2002, Matthijs van Duin wrote:
> At 22:05 -0400 23-05-2002, Craig Newell wrote:
> >I am using explicit register variables to place arguments and return
> >values in the correct registers for system calls. eg.
>
> I had a similar problem (with trying to use CMPXCHG which uses %eax
> as a hard register)
>
> the solution was to make the variables "volatile register"
Am I the only one that feels that this is the wrong approach?
You can specify in the constraints for the asm expression that the
variable should go into register a so there should be no need to do any of
the tricks you are using.