Subject: None
To: Lenny <lli02@cs.auckland.ac.nz>
From: Chris G Demetriou <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU>
List: port-alpha
Date: 08/03/1995 09:57:56
> Hi. I would appreciate information on the following issue:
> When declaring register variables on the Alpha, memory seems to be
> allocated both for saving the previous value of the register, and for the
> register variable itself. The space for the regsiter variable seems to
> never be used (the register is used instead). Perhaps it is needed because
> the compiler might later realise that it needs to use the register for
> someother purpose. However, I have yet to find a program in which this
> space is used. ( I tried having a local block which also used register
> variables, but that didn't help). Why is this extra space allocated?

uh, do you have an example where it does this double allocation?  i
just tried a simple example, and it _didn't_ allocate _any_ space for
the register variable (either to save the old register's contents, or
to store the variable's value)...

It probably allocates the space for exactly the reason you describe.
Don't forget that:
	(1) the compiler can have many uses for a given register, and,
	(2) a C 'register' declaration really means nothing more
	    than 'I will not take the address of this variable' -- in
	    particular, it doesn't mean that the variable will
	    actually be assigned a register, etc.  It's advisory only,
	    and a good optimizer many times will completely ignore
	    it...



chris