Re: Caller/Callee saved Registers

bart@cs.uoregon.edu (Barton Christopher Massey)
Wed, 23 Mar 1994 08:01:04 GMT

          From comp.compilers

Related articles
[2 earlier articles]
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-22)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-22)
Caller/Callee saved Registers ssimmons@convex.com (1994-03-22)
Re: Caller/Callee saved Registers paulb@travis.csd.harris.com (1994-03-22)
Re: Caller/Callee saved Registers cliffc@noel.cs.rice.edu (1994-03-22)
Re: Caller/Callee saved Registers alk@et.msc.edu (1994-03-23)
Re: Caller/Callee saved Registers bart@cs.uoregon.edu (1994-03-23)
Re: Caller/Callee saved Registers robertsw@agcs.com (1994-03-23)
Re: Caller/Callee saved Registers Peter-Lawrence.Montgomery@cwi.nl (1994-03-24)
Re: Caller/Callee saved Registers pdp8@ai.mit.edu (1994-03-24)
Re: Caller/Callee saved Registers ghiya@flo.cs.mcgill.ca (1994-03-24)
Re: Caller/Callee saved Registers paulb@travis.csd.harris.com (1994-03-24)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-24)
[21 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: bart@cs.uoregon.edu (Barton Christopher Massey)
Keywords: registers, optimize
Organization: University of Oregon Computer and Information Sciences Dept.
References: 94-03-054 94-03-096
Date: Wed, 23 Mar 1994 08:01:04 GMT

One additional point about caller vs. callee save which I'm surprised no
one has mentioned: callee-save makes it rather more difficult to implement
tail-call optimization. Recall that full tail-call (as opposed to mere
self tail-recursion) optimization avoids saving any state (including a
return address) whenenever the last instruction in a procedure is a call
to another procedure. This is a very valuable optimization for recursive
programs, but to implement it on a machine with callee-save registers
typically requires a second entry point to the procedure which avoids the
(unnecessary) saves during a tail-call. I know of no C-based systems
whose calling conventions support multiple entry points to a procedure, so
unless the C calling conventions for a system don't require callee-saves,
your C compiler can't implement full tail-call on it.


(I hope the above paragraph wasn't too opaque.)


Bart Massey
bart@cs.uoregon.edu
--


Post a followup to this message

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