performance through static variables in fortran

Viewed 970

In Fortran, you cannot call subroutines or functions recursivly without explicitly declaring them as recursive. A Fortran programmer told me, that because of this, the compiler can assign static storage to all local variables which increases the speed of the program. I am very surprised by that claim, since most processors today are optimized for fast references to the stack. I think, local variables that are loaded from a static adress probably cause a lot of cache misses, since the static adress is not used by other subroutines as opposed to the stack.

Is there really a speed up from local variables at static addresses? What other optimizations are possible disallowing recursive subroutines and functions?

2 Answers
Related