C vs. FORTRAN
Steven Ryan
smryan at garth.UUCP
Sat Jul 2 06:35:41 AEST 1988
>|>and therefore no necessity of copying parameters to a stack. They
>|>can be statically compiled in. This is only a benefit on some
>|>architectures.
>
>What do you mean by 'statically compiled in'? The references still need to
>be copied; they (the references) are just copied to a fixed location
>instead of to a relative position off the argument pointer (which points
>into the stack).
Fortran argument list are sometimes assigned static memory by the compiler.
Except for arguments which are subscripted arrays, the compiler will know
the addresses of the will be put into the argument list (assuming variables
are staticcally allocated and not stack allocated). The overhead for passing
arguments is then computing expressions and stuffing away their values (same
for either language) and getting the parameter list address in the proper
register.
Any language which supports recursion must allocate local variables and
parameter lists on the stack. The address of variables must be computed
at runtime.
More information about the Comp.lang.c
mailing list