This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, fortran] PR20441 -finit-local-zero


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]