|Register allocation in the presence of pointers firstname.lastname@example.org (1990-02-22)|
|Re: Register allocation in the presence of pointers email@example.com (1990-02-22)|
|From:||firstname.lastname@example.org (Jonathan A. Chandross)|
|Date:||22 Feb 90 22:27:56 GMT|
|Organization:||Rutgers Univ., New Brunswick, N.J.|
Mohd Hanafiah b. Abdullah writes:
> How does one perform register allocation on scalar variables that may
> be pointed to by others?
email@example.com (Dale Worley)
> The usual strategy is to never leave the value of the variable in a register,
> since it may be fetched or modified at any time via the pointer. On some
> hardware, registers have addresses and this conservative strategy may not be
I suspect you will still have to perform the flow analysis even if the
register has a memory address because a register might be be spilled at
any given time. This would mean that the pointer would modify the value
in the register, not in the memory location that register was spilled to.
Certainly would make for interesting bugs.
Jonathan A. Chandross
[I suspect he was assuming that the variable is in the register for the
duration of the routine, but your point is well taken. Particularly if
you pass a pointer to the variable to another procedure, the variable
is liable not to be there by the time the pointer is deferenced. -John]
Return to the
Search the comp.compilers archives again.