This bug is similar to pr41860. When a variable becomes static due to being larger than -fmax-stack-var-size, the variable is still given an automatic initializer on entry to its namespace by the -finit-* flags (-finit-integer, -finit-local-zero, etc...) This is probably an oversight due to the fact that the initializers are generated at resolution time in resolve.c, but the size of the variable is not known until translation time (in trans-decl.c). S.A. the thread at https://gcc.gnu.org/ml/fortran/2016-06/msg00023.html
Created attachment 38697 [details] Patch for pr71523 Patch submitted, see https://gcc.gnu.org/ml/fortran/2016-06/msg00032.html
> Patch submitted, see https://gcc.gnu.org/ml/fortran/2016-06/msg00032.html
> Patch submitted, see https://gcc.gnu.org/ml/fortran/2016-06/msg00032.html Hit return too soon!-( The patch works as advertised. I think you should ping the mailing lists and assign the PR to yourself.
Author: jvdelisle Date: Sun Jul 17 20:13:41 2016 New Revision: 238420 URL: https://gcc.gnu.org/viewcvs?rev=238420&root=gcc&view=rev Log: 2016-07-17 Fritz Reese <fritzoreese@gmail.com> PR fortran/71523 * trans-decl.c (gfc_finish_var_decl): Replace automatic initializer with a static one. * gfortran.dg/pr71523_1.f90: New test. * gfortran.dg/pr71523_2.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/pr71523_1.f90 trunk/gcc/testsuite/gfortran.dg/pr71523_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-decl.c trunk/gcc/testsuite/ChangeLog
Fixed, Closing