+2019-01-19 Dominique d'Humieres <dominiq@gcc.gnu.org>
+
+ PR fortran/37835
+ * resolve.c (resolve_types): Add !flag_automatic.
+ * symbol.c (gfc_add_save): Silence warnings.
+
2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77960
variables smaller than the value given by @option{-fmax-stack-var-size}.
Use the option @option{-frecursive} to use no static memory.
+Local variables or arrays having an explicit @code{SAVE} attribute are
+silently ignored unless the @option{-pedantic} option is added.
+
@item -ff2c
@opindex ff2c
@cindex calling convention
gfc_traverse_ns (ns, resolve_values);
- if (ns->save_all)
+ if (ns->save_all || !flag_automatic)
gfc_save_all (ns);
iter_stack = NULL;
if (s == SAVE_EXPLICIT)
gfc_unset_implicit_pure (NULL);
- if (s == SAVE_EXPLICIT && attr->save == SAVE_EXPLICIT)
+ if (s == SAVE_EXPLICIT && attr->save == SAVE_EXPLICIT
+ && (flag_automatic || pedantic))
{
if (!gfc_notify_std (GFC_STD_LEGACY,
"Duplicate SAVE attribute specified at %L",
+2019-01-18 Dominique d'Humieres <dominiq@gcc.gnu.org>
+
+ PR fortran/37835
+ * gfortran.dg/no-automatic.f90: New test.
+
2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77960
--- /dev/null
+! { dg-do run }
+! { dg-options "-fno-automatic" }
+!
+! PR fortran/37835
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>.
+!
+subroutine foo(n)
+ integer :: n
+ type t
+ integer :: i = 42
+ end type t
+ type(t) :: myt
+ if(n==1) myt%i = 2
+ print *, myt%i
+ if (n > 1 .and. myt%i /= 2) stop 1
+end subroutine foo
+
+call foo(1)
+call foo(2)
+end