https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37835
--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Updated patch --- ../_clean/gcc/fortran/resolve.c 2019-01-13 08:36:53.000000000 +0100 +++ gcc/fortran/resolve.c 2019-01-15 11:06:51.000000000 +0100 @@ -16649,7 +16649,7 @@ resolve_types (gfc_namespace *ns) gfc_traverse_ns (ns, resolve_values); - if (ns->save_all) + if (ns->save_all || !flag_automatic) gfc_save_all (ns); iter_stack = NULL; With this patch the tests gfortran.dg/dec_static_2.f90 gfortran.dg/save_1.f90 gfortran.dg/save_5.f90 gfortran.dg/save_6.f90 regress with Warning: Legacy Extension: Duplicate SAVE attribute specified at (1) At this point I don't know what to do. I can (1) adjust the tests by removing the explicit SAVEs, (2) add -w to the options to silence the warning, (3) adjust the doc to say that -fno-automatic should not be used in TUs with variables having an explicit SAVE attribute, (4) add a suitable condition to the test, (5) leave thing as they are now and close the PR as WONTFIX or INVALID, (6) ...