Interaction of -finit-local-zero and -fno-automatic

Andrew Senior a.senior@lancaster.ac.uk
Thu Oct 29 12:54:00 GMT 2009


Thank you very much Janne (and Steve) for looking into this problem so 
quickly.

Regards,

Andrew.

Janne Blomqvist wrote:
>> Based on past experience using g77, which has the same two flags as
>> gfortran, I'd expect the first run above to produce the same result as the
>> second one. With gfortran, it seems as if making a local variable static
>> with -fno-automatic doesn't prevent it being re-initialised to zero by
>> -finit-local-zero when the subroutine is called. However, making it static
>> with 'save' does prevent this re-initialisation.
> 
> Yes, this doesn't make sense. This is now bug 41860
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41860
> 



More information about the Fortran mailing list