Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think!snorkelwacker!spdcc!esegue!compilers-sender From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.compilers Subject: Re: Register Allocation Summary: It is not possible on most computers without excessive cost Keywords: Pointers Message-ID: <1990Feb24.210757.4202@esegue.segue.boston.ma.us> Date: 24 Feb 90 21:07:57 GMT References: <1990Feb20.155619.3121@esegue.segue.boston.ma.us> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: cik@l.cc.purdue.edu (Herman Rubin) Organization: Compilers Central Lines: 24 Approved: compilers@esegue.segue.boston.ma.us 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. > > I am sure there is a solution to this problem and has been asked before > in the newsgroup, but could you please e-mail the answer to me anyway? Unfortunately, this is not the case. I have frequently wanted to do this, and I have no difficulty using machine language. The only mainframes whose instruction set I have known which are appropriately set up in hardware for this are the long obsolete UNIVAC 1108 and 1110. There are some I have seen for which this can be done with difficulty, but it would not be faster than keeping the items in memory. [The PDP-10/DEC-20 has addressable registers as well, but as pointed out elsewhere that's only a small part of the problem. As soon as you call another routine, it's liable to save the register and put something else there, and you lose. -John] -- 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.