Path: utzoo!mnetor!uunet!husc6!think!ames!pacbell!att-ih!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.fortran Subject: Re: Fortran 8x, recursive procedures Message-ID: <2243@ttrdc.UUCP> Date: 24 Mar 88 00:37:50 GMT References: <522@a.UUCP> Distribution: na Organization: AT&T, Skokie, IL Lines: 22 Keywords: Fortran 8x standard, recursive In article <522@a.UUCP>, jlg@a.UUCP (Jim Giles) writes: [possible reasons why RECURSIVE keyword is still in F8x] # ...in spite of the introduction of SAVE in Fortran # 77, many Fortran environments have not fully implemented stack-based code. # Since stack-based code is absolutely required for recursion to work, the # committee wanted to make it possible for the compiler to generate stack # references ONLY for the recursive procedures. Non-recursive procedures # would continue to work as before (and without the stack references they # might run slightly faster). Plain-vanilla UNIX f77 (not exactly a paradigm of efficiency) will, in fact, produce significantly faster and somewhat smaller code when stack references are forced (via the extension storage class AUTOMATIC) than the default, where it will use static data. It is faster on many machines to reference memory indexed with small offsets from a register (i.e. the stack pointer) than it is to reference it by absolute address. So, stack-based code is a win-win situation with respect to both efficiency and recursion. -- |------------Dan Levy------------| Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, | an Engihacker @ | }!ttrdc!ttrda!levy | AT&T Computer Systems Division | Disclaimer? Huh? What disclaimer??? |--------Skokie, Illinois--------|