Path: utzoo!attcan!uunet!husc6!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!garth!smryan From: smryan@garth.UUCP (Steven Ryan) Newsgroups: comp.lang.c Subject: Re: C vs. FORTRAN Message-ID: <852@garth.UUCP> Date: 1 Jul 88 20:35:41 GMT References: <3136@phoenix.Princeton.EDU> <225800038@uxe.cso.uiuc.edu> <797@garth.UUCP> <5173@ihlpf.ATT.COM> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 20 >|>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.