[Bug fortran/53818] -finit-local-zero -fno-automatic: Function result cannot have initializer
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jun 30 14:41:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53818
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-06-30 14:41:08 UTC ---
Draft patch - completely untested.
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -10271,3 +10330,3 @@ apply_default_init_local (gfc_symbol *sym)
if (sym->attr.save || sym->ns->save_all
- || (gfc_option.flag_max_stack_var_size == 0
+ || (gfc_option.flag_max_stack_var_size == 0 && !sym->attr.result
&& (!sym->attr.dimension || !is_non_constant_shape_array (sym))))
More information about the Gcc-bugs
mailing list