This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, fortran] PR20441 -finit-local-zero
- From: Tobias Burnus <burnus at net-b dot de>
- To: Bud Davis <bdavis9659 at sbcglobal dot net>
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 21 Sep 2007 18:01:06 +0200
- Subject: Re: [PATCH, fortran] PR20441 -finit-local-zero
- References: <2880.76089.qm@web81209.mail.mud.yahoo.com>
Bud Davis wrote:
>> Which initialization do you expect for -finit-* for equivalenced
>> variables such as A and F above? How do other compilers handle this?
>>
> I would expect 0. Which is the one value that works for both integer and real:):)
>
Well, for -finit-local-zero there is no ambiguity; if it would give a
SIGFPE for -finit-real=snan similar to NAG's -nan would be nice
nonetheless. (NAG only has -nan and thus there is no ambiguity; gfortran
currently only supports quiet NaN.)
> As a user, the -finit-zero option is the one I care about, simply because it is needed
> to make old code work...from long gone systems that provided you with zero filled memory
> by default.
>
For EQUIVALENCE, not many compilers seem to initialize the variables.
Even compilers which by default initialize some variables by zero do not
seem to do this for equivalenced variables:
- ifort does not
- NAG f95 does not
- openf95 does not
Tobias