Fritz Reese wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62309 > > It seems with gcc-4.8.3 -fno-automatic prevents initializers from > being applied to automatic variables. [...] > According to gfortran's manual page, -fno-automatic should "Treat each > program unit (except those marked as RECURSIVE) as if the "SAVE" > statement were specified for every local variable [...]". As far as I > can tell, -finit-local-zero should still initialize automatic > variables in RECURSIVE functions. > > I believe this is a simple fix; to actually follow the specification > set forth in the man page, don't treat symbols in a RECURSIVE > namespace as if they are saved in resolve.c > (apply_default_init_local): Thanks for the patch. I think it qualifies as obvious. But note for potential future contributions that for nontrivial contributions a copyright assignment with the FSF is required: https://gcc.gnu.org/contribute.html (Tiny nit: 8 spaces are replaced by a tab.) I initially thought that one had to be more careful because of BLOCK, but the RECURSIVE is passed on those namespaces, hence, the patch works fine. I have extended the test case to cover that part as well. I have now committed the attached version of the patch to the trunk (GCC 5) as Rev. 214771. Tobias (Side remark: I think it is bad style to rely on -finit-local with new code - and RECURSIVE is new since Fortran 90) code.) > 2014-08-29 Fritz Reese > > * resolve.c (apply_default_init_local): Don't treat variables in > RECURSIVE units as saved.