This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Using local register variable
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: "Tal Agmon" <Tal dot Agmon at nsc dot com>
- Cc: gcc-help at gcc dot gnu dot org, "Tomer Levi" <Tomer dot Levi at nsc dot com>
- Date: 30 Dec 2003 18:13:10 +0100
- Subject: Re: Using local register variable
- References: <OFF9ED0148.03661146-ONC2256E0C.0059A85C-C2256E0C.0059E06C@nsc.com>
"Tal Agmon" <Tal.Agmon@nsc.com> writes:
> The manual says:
> You can define a local register variable with a specified register like
> this:
> register int *foo asm ("a5");
>
> My question: is foo must be a pointer or can I define for example:
> register int y asm ("a5");
Both are legal.
> I'm asking this because in gcc-3.3.2 I saw (in a very simple program
> with no reason not the preserve a register) that a5 was not
> preserved for y, and when I defined it as in the first example, a5
> WAS preserved for foo.
I don't understand what you mean by "preserve", so I can't comment on
this...
>
--
Falk