g77 large array

Robert Dewar dewar@gnat.com
Wed Oct 15 10:40:00 GMT 2003


> In this case, two arrays do not need memory at the same time.
> Cannot SUBROUTINE B use the same memory area as A in Fortran compiler,
> even if I do not declare explicitly COMMON I?
> I should write about the machine.

Usually convention in Fortran is to allocate all storage statically. So indeed
one would not expect these two arrays to overlap. I am not sure about the current
Fortran standard, but earlier Fortran standards certainly *allowed* stack allocation
of such arrays, but in practice, static allocation (also certainly allowed) was
so standard, that all compilers do static allocation.

So what you are seeing makes perfect sense



More information about the Gcc mailing list