public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Using local register variable
@ 2003-12-30 16:25 Tal Agmon
  2003-12-30 17:13 ` Falk Hueffner
  0 siblings, 1 reply; 6+ messages in thread
From: Tal Agmon @ 2003-12-30 16:25 UTC (permalink / raw)
  To: gcc-help; +Cc: Tomer Levi

Hi,

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");

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.

Regards,

   Tal.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using local register variable
  2003-12-30 16:25 Using local register variable Tal Agmon
@ 2003-12-30 17:13 ` Falk Hueffner
  0 siblings, 0 replies; 6+ messages in thread
From: Falk Hueffner @ 2003-12-30 17:13 UTC (permalink / raw)
  To: Tal Agmon; +Cc: gcc-help, Tomer Levi

"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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using local register variable
  2003-12-31  7:57 Tal Agmon
@ 2003-12-31  8:21 ` Falk Hueffner
  0 siblings, 0 replies; 6+ messages in thread
From: Falk Hueffner @ 2003-12-31  8:21 UTC (permalink / raw)
  To: Tal Agmon; +Cc: gcc-help

"Tal Agmon" <Tal.Agmon@nsc.com> writes:

> I meant that a5 was used when I defined a pointer foo and it wasn't
> used when I defined int y.

It was probably optimized out. Maybe you can show us the actual
example?

-- 
	Falk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using local register variable
@ 2003-12-31  7:57 Tal Agmon
  2003-12-31  8:21 ` Falk Hueffner
  0 siblings, 1 reply; 6+ messages in thread
From: Tal Agmon @ 2003-12-31  7:57 UTC (permalink / raw)
  To: gcc-help


I meant that a5 was used when I defined a pointer foo and it wasn't used
when I defined int y.





"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









^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using local register variable
@ 2003-12-30 18:38 Tal Agmon
  0 siblings, 0 replies; 6+ messages in thread
From: Tal Agmon @ 2003-12-30 18:38 UTC (permalink / raw)
  To: gcc-help; +Cc: Tomer Levi


I meant that a5 was used when I defined a pointer foo and it wasn't used
when I defined int y.



                                                                                                                                                 
                      "Falk Hueffner"                                                                                                            
                      <falk.hueffner@student.uni-tu        To:       "Tal Agmon" <Tal.Agmon@nsc.com>                                             
                      ebingen.de>                          cc:       gcc-help@gcc.gnu.org, "Tomer Levi" <Tomer.Levi@nsc.com>                     
                                                           Subject:  Re: Using local register variable                                           
                      12/30/03 07:13 PM                                                                                                          
                                                                                                                                                 
                                                                                                                                                 




"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








^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using local register variable
@ 2003-12-30 17:34 Tal Agmon
  0 siblings, 0 replies; 6+ messages in thread
From: Tal Agmon @ 2003-12-30 17:34 UTC (permalink / raw)
  To: Falk Hueffner; +Cc: gcc-help, Tomer Levi


I meant that a5 was used when I defined a pointer foo and it wasn't used
when I defined int y.



                                                                                                                                                 
                      "Falk Hueffner"                                                                                                            
                      <falk.hueffner@student.uni-tu        To:       "Tal Agmon" <Tal.Agmon@nsc.com>                                             
                      ebingen.de>                          cc:       gcc-help@gcc.gnu.org, "Tomer Levi" <Tomer.Levi@nsc.com>                     
                                                           Subject:  Re: Using local register variable                                           
                      12/30/03 07:13 PM                                                                                                          
                                                                                                                                                 
                                                                                                                                                 




"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







^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-31  8:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-30 16:25 Using local register variable Tal Agmon
2003-12-30 17:13 ` Falk Hueffner
2003-12-30 17:34 Tal Agmon
2003-12-30 18:38 Tal Agmon
2003-12-31  7:57 Tal Agmon
2003-12-31  8:21 ` Falk Hueffner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).