Re: Caller/Callee saved Registers

pardo@cs.washington.edu (David Keppel)
Tue, 29 Mar 1994 04:03:33 GMT

          From comp.compilers

Related articles
[20 earlier articles]
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers anton@mips.complang.tuwien.ac.at (1994-03-28)
Re: Caller/Callee saved Registers zsh@cs.princeton.edu (1994-03-27)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-28)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-29)
Re: Caller/Callee saved Registers bart@cs.uoregon.edu (1994-03-29)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-29)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-29)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-31)
Re: Caller/Callee saved Registers conway@munta.cs.mu.OZ.AU (1994-04-02)
Re: Caller/Callee saved Registers nandu@cs.clemson.edu (1994-04-21)
[3 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: pardo@cs.washington.edu (David Keppel)
Keywords: registers, optimize
Organization: Computer Science & Engineering, U. of Washington, Seattle
References: 94-03-054 94-03-133
Date: Tue, 29 Mar 1994 04:03:33 GMT

bart@cs.uoregon.edu (Barton Christopher Massey) writes:
>[I admit callee-save allows tail recursion, but may lead to excess
> spills and restores of registers that are needed but which must be
> saved across the recursive calls.]


Typical caller/callee-save divisions leave a "modest" number of free
caller-save registers (e.g. 10) for the body of each procedure, so only
"larger" routines (those that need many registers) need to save and
restore callee-save regs.


Further, since tail-recursion can be transformed in to iteration, spills
and restores of registers can be placed outside of the iteration, e.g.


f: ... ! normal entry
spill
f': ... ! tail-recursion loop entry
body
bn.cnd f' ! iteration/recursion
restore
return


I believe this is what GNU CC does in some cases (it is thus able to
inline recursive calls). In other cases the code at f' allocates stack
space (but is less general than f) and in some cases it uses the standard
calling convention.


;-D on ( Have your registers been SAVED? ) Pardo
--


Post a followup to this message

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