On Fri, 31 Mar 2000, Phillip Helbig wrote:
> > I see, it makes sense. But then I wonder what other copilers do, see for
> > example g77: [taken from the info manual]
> >
> > `-fno-automatic'
> > Treat each program unit as if the `SAVE' statement was specified
> > for every local variable and array referenced in it. Does not
> > affect common blocks. (Some Fortran compilers provide this option
> > under the name `-static'.)
> >
> > This seems to imply that this compiler switch forces all automatic objects
> > to be allocated on the heap, and not deallocated on exit from the
> > subroutine in question. Am I over-interpreting too much here?
>
> I'm no g77 user, but I think it is talking about "normal" variables
> (including arrays), not automatic arrays. The switch is NO AUTOMATIC,
> meaning they should not be automatic. "Automatic" is sometimes used as
> an antonym to "static", though "volatile" probably captures the meaning
> better. This has nothing to do with "automatic arrays".
I think the g77 manual is talking about *local* variables, including
arrays. And remember that g77 _has_ automatic arrays.
The switch makes them "non-automatic". So I take it that means that they
are allocated once, and never de-allocated (if that's what they mean by
"as if SAVE was specified). Then we have the problem that Malcolm pointed
out. Anyone can explain this?
My guess is that automatic arrays, whether allocated on the heap or the
stack, will have to be allocated/deallocated on each call to the
subroutine.
Jose
--
Jose L Marin [log in to unmask]
Dept of Mathematics [log in to unmask]
Heriot-Watt University
Edinburgh EH14 4AS, U.K.
Phone: +44 131 451 3717
Fax: +44 131 451 3249
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|