Re: Parameter Passing Via Registers

mike@taumet.com (Michael S. Ball)
30 Apr 91 16:03:50 GMT

          From comp.compilers

Related articles
Parameter Passing Via Registers lins@apple.com (Chuck Lins) (1991-04-29)
Re: Parameter Passing Via Registers preston@ariel.rice.edu (1991-04-30)
Re: Parameter Passing Via Registers mike@taumet.com (1991-04-30)
Re: Parameter Passing Via Registers zlsiial@cms.manchester-computing-centre.ac.uk (A. V. Le Blanc) (1991-04-30)
Re: Parameter Passing Via Registers mike@yalla.tuwien.ac.at (1991-04-30)
Re: Parameter Passing Via Registers ram+@cs.cmu.edu (Rob MacLachlan) (1991-05-01)
Re: Parameter Passing Via Registers mauney@eos.ncsu.edu (1991-05-02)
Re: Parameter Passing Via Registers mike@vlsivie.tuwien.ac.at (1991-04-30)
Re: Parameter Passing Via Registers mario@cs.man.ac.uk (Mario Wolczko) (1991-05-02)
[2 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: mike@taumet.com (Michael S. Ball)
Keywords: optimize, registers, Pascal, Modula
Organization: Taumetric Corporation, San Diego
References: <1991Apr30.022048.4539@iecc.cambridge.ma.us>
Date: 30 Apr 91 16:03:50 GMT

In article <1991Apr30.022048.4539@iecc.cambridge.ma.us> Chuck Lins <lins@apple.com> writes:
>Does anyone know how nested procedures affect the ability to pass parameters
>via registers? If there was no up-level access everything would work fine,
>but with this facility you get all sorts of problems. Uplevel access would
>also seem to affect dataflow analysis (the compiler could think that a
>variable is 'dead' when in reality it's going to get accessed by a nested
>local procedure.


Actually, since you have the bodies of the nested procedures available
before compiling the body of the enclosing procedure you have all of the
data necessary to do a good job. Any register parameter which is
used by uplevel reference is simply stored on the stack, just as it
would be in a C function using varargs.


I don't know that Pascal and Modula compilers pass parameters on the
stack any more than C compilers do. My experience is that they use
the calling sequence established by the execution environment. Of course
with languages like Pascal which encourage internal linkage, compilers
are able to establish their own sequences, and on machines like the
VAX, where calls are expensive, they frequently do. You can do the
same with C, but static functions seem to be rare.
--
Michael S. Ball mike@taumet.com
TauMetric Corporation (619)697-7607
--


Post a followup to this message

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