Re: Register allocation in the presence of pointers

jac@paul.rutgers.edu (Jonathan A. Chandross)
22 Feb 90 22:27:56 GMT

          From comp.compilers

Related articles
Register allocation in the presence of pointers worley@compass.com (1990-02-22)
Re: Register allocation in the presence of pointers jac@paul.rutgers.edu (1990-02-22)
| List of all articles for this month |

From: jac@paul.rutgers.edu (Jonathan A. Chandross)
Newsgroups: comp.compilers
Date: 22 Feb 90 22:27:56 GMT
References: <1990Feb22.180326.11309@esegue.segue.boston.ma.us>
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?


worley@compass.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
> needed.


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
Internet: jac@paul.rutgers.edu
UUCP: rutgers!paul.rutgers.edu!jac
[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]





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.