home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / arch / 12056 < prev    next >
Encoding:
Internet Message Format  |  1993-01-03  |  1.4 KB

  1. Path: sparky!uunet!cbmvax!jesup
  2. From: jesup@cbmvax.commodore.com (Randell Jesup)
  3. Newsgroups: comp.arch
  4. Subject: Re: No Last Call Optimization on Sparc and DECstation
  5. Message-ID: <38261@cbmvax.commodore.com>
  6. Date: 4 Jan 93 04:14:02 GMT
  7. References: <1992Dec30.094352.4243@cucs5.cs.cuhk.hk> <1993Jan2.144518.20826@walter.bellcore.com> <1993Jan02.222131.21638@microsoft.com>
  8. Reply-To: jesup@cbmvax.commodore.com (Randell Jesup)
  9. Organization: Commodore, West Chester, PA
  10. Lines: 23
  11.  
  12. raymondc@microsoft.com (Raymond Chen) writes:
  13. >I figure stack management is the toughest part.  the "caller cleans the
  14. >stack" calling convention used by many compilers (to make variadic
  15. >functions easier) makes it impossible to optimize the last call in a
  16. >function like
  17. >
  18. >    f(a) { return g(a, 2); }
  19. >
  20. >because f's caller will clean only one word from the stack, whereas
  21. >g will leave two words of garbage on the stack when it exits.
  22.  
  23.     Actually, if you pass the first N arguments in registers, most such
  24. calls can use last-call optimization.  I think most RISC compilers pass
  25. some arguments in registers.  Even the SAS/C Amiga compiler will pass up to
  26. 2 pointers and 2 integers in registers.
  27.  
  28. -- 
  29. GNU Emacs is a LISP operating system disguised as a word processor.
  30.  - Doug Mohney, in comp.arch
  31.  
  32. Randell Jesup, Jack-of-quite-a-few-trades, Commodore Engineering.
  33. jesup@cbmvax.commodore.com  BIX: rjesup  
  34. Disclaimer: Nothing I say is anything other than my personal opinion.
  35.