[comp.compilers] Stack formats and Code folding from JSR/RTS -> {Local}

rfg@uunet.UU.NET (Ron Guilmette) (05/07/91)

In article <1991May1.035622.25021@daffy.cs.wisc.edu> carter@cs.wisc.edu (Gregory Carter) writes:
>Hello...
>
>I don't know if this is incredibly obvious or what, but in the OLDEN DAYS
>when I was working on a 6502 machine.  Speed was of the upmost...ad nauseum..
>
>What I want to know, if any of you have considered, for high speed applications
>to get that extra push, what the problems would be in compiler design to:
>
>1) Transcribe all local variables to global ones.

For certain machines which do not efficiently support stacks, it may be
useful (for C and C++) to declare formal parameter variables as storage
class `static'.  There's only one problem.  Neither C nor C++ allow
formal parameters to be declared `static'.  (Note however that C and C++
allow formal parameters to be declared as `register'.)

I have recently noted this apparent language shortcomming the x3j16 (the
ANSI C++ Standardization Committee), however there seems to be little (if
any) interest in adding such a feature to C++.
-- 

// Ron ("Loose Cannon") Guilmette
// Internet: rfg@ncd.com      uucp: ...uunet!lupine!rfg
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.