+2005-06-22 Paul Brook <paul@codesourcery.com>
+
+ PR fortran/21034
+ * symbol.c (gfc_is_var_automatic): New function.
+ (save_symbol): Use it.
+
2005-06-21 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
Paul Thomas <pault@gcc.gnu.org>
}
+/* Return TRUE if the symbol is an automatic variable. */
+static bool
+gfc_is_var_automatic (gfc_symbol * sym)
+{
+ /* Pointer and allocatable variables are never automatic. */
+ if (sym->attr.pointer || sym->attr.allocatable)
+ return false;
+ /* Check for arrays with non-constant size. */
+ if (sym->attr.dimension && sym->as
+ && !gfc_is_compile_time_shape (sym->as))
+ return true;
+ /* Check for non-constant length character vairables. */
+ if (sym->ts.type == BT_CHARACTER
+ && sym->ts.cl
+ && gfc_is_constant_expr (sym->ts.cl->length))
+ return true;
+ return false;
+}
+
/* Given a symbol, mark it as SAVEd if it is allowed. */
static void
|| sym->attr.dummy
|| sym->attr.flavor != FL_VARIABLE)
return;
-
+ /* Automatic objects are not saved. */
+ if (gfc_is_var_automatic (sym))
+ return;
gfc_add_save (&sym->attr, sym->name, &sym->declared_at);
}
+2005-06-22 Paul Brook <paul@codesourcery.com>
+
+ PR fortran/21034
+ * gfortran.dg/auto_save_1.f90: New test.
+
2005-06-22 Michael Matz <matz@suse.de>
* gcc.target/x86-64/abi: New directory.