This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, fortran] PR20441 -finit-local-zero
- From: Thomas Koenig <tkoenig at alice-dsl dot net>
- To: Asher Langton <langton2 at llnl dot gov>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 01 Sep 2007 22:26:35 +0200
- Subject: Re: [PATCH, fortran] PR20441 -finit-local-zero
- References: <1953a4560708171312u705f5bf4ie9d8ce645d2f02b6@mail.gmail.com> <1953a4560708311456g550c60a8xd4a0ffa9335c4325@mail.gmail.com>
Asher Langton wrote:
Hi Asher,
> Here's an updated patch. I've added -finit-character=<n>, where 0 <=
> n <= 127 is an ASCII value. Derived types aren't initialized, but
> I've documented this in the manual. I've added a test that checks
> initialization of SAVE'd variables. This has been bootstrapped (+make
> pdf) and regression tested on x86_64-unknown-linux-gnu.
Equivalenced variables are not initialized by your patch:
$ cat foo.f
program main
call foo
end
subroutine foo
equivalence(i,j)
print *,j
end
$ g77 -finit-local-zero foo.f && ./a.out
0
$ gfortran -finit-local-zero foo.f && ./a.out
1
This behavior is different from g77, so I think it should be either
documented, or the behavior changed to match g77. Of course, if the
user specifies -finit-integer and -finit-real and equivalences the
values, he's on his own :-)
Thomas