Article View: comp.arch
Article #11360Re: No Last Call Optimization on Sparc and DECstation
From: Randell Jesup
Date: Mon, 04 Jan 1993 04:14
Date: Mon, 04 Jan 1993 04:14
23 lines
1485 bytes
1485 bytes
raymondc@microsoft.com (Raymond Chen) writes:
>I figure stack management is the toughest part. the "caller cleans the
>stack" calling convention used by many compilers (to make variadic
>functions easier) makes it impossible to optimize the last call in a
>function like
>
> f(a) { return g(a, 2); }
>
>because f's caller will clean only one word from the stack, whereas
>g will leave two words of garbage on the stack when it exits.
Actually, if you pass the first N arguments in registers, most such
calls can use last-call optimization. I think most RISC compilers pass
some arguments in registers. Even the SAS/C Amiga compiler will pass up to
2 pointers and 2 integers in registers.
--
GNU Emacs is a LISP operating system disguised as a word processor.
- Doug Mohney, in comp.arch
Randell Jesup, Jack-of-quite-a-few-trades, Commodore Engineering.
jesup@cbmvax.commodore.com BIX: rjesup
Disclaimer: Nothing I say is anything other than my personal opinion.
Technical Details
Message-ID:
<38261@cbmvax.commodore.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cbmvax!jesupReferences:
<1992Dec30.094352.4243@cucs5.cs.cuhk.hk> <1993Jan2.144518.20826@walter.bellcore.com> <1993Jan02.222131.21638@microsoft.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.arch Subject: Re: No Last Call Optimization on Sparc and DECstation Message-ID: <38261@cbmvax.commodore.com> Date: 4 Jan 93 04:14:02 GMT References: <1992Dec30.094352.4243@cucs5.cs.cuhk.hk> <1993Jan2.144518.20826@walter.bellcore.com> <1993Jan02.222131.21638@microsoft.com> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 23