Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!spdcc!mirror!ima!esegue!compilers-sender From: Moss@cs.umass.edu (Eliot Moss) Newsgroups: comp.compilers Subject: Re: Register Allocation Message-ID: <1990Feb26.214750.10649@esegue.segue.boston.ma.us> Date: 26 Feb 90 21:47:50 GMT References: <1990Feb20.155619.3121@esegue.segue.boston.ma.us> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: Moss@cs.umass.edu (Eliot Moss) Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst) Lines: 28 Approved: compilers@esegue.segue.boston.ma.us In-Reply-To: napi@rangkom.MY's message of 20 Feb 90 15:56:19 GMT In article <1990Feb20.155619.3121@esegue.segue.boston.ma.us> napi@rangkom.MY (Mohd Hanafiah b. Abdullah) writes: How does one perform register allocation on scalar variables that may be pointed to by others? I am curious because, a pointer assumes that the variable it points to resides in memory, but in actuality the variable resides in a register. Well, you either do not allocate it to a register, or you propagate its value to its memory home whenever (a) it may have changed since the last time you did so, and (b) there is a possibility that the memory value may be picked up through an aliasing pointer. If (a) and (b) occur together often enough, then there is little benefit to putting the variable in a register, but if they occur rarely compared with use of the variables, then there may be benefit. Of course, you could use a machine such as the DEC PDP-10 where the registers *are* addressable memory (the first 16 locations) ... :-) Eliot -- J. Eliot B. Moss, Assistant Professor Department of Computer and Information Science Lederle Graduate Research Center University of Massachusetts Amherst, MA 01003 (413) 545-4206; Moss@cs.umass.edu -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus}!esegue. Meta-mail to compilers-request@esegue. Please send responses to the author of the message, not the poster.