[Bug fortran/93263] [9/10 Regression] -fno-automatic and RECURSIVE

markeggleston at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 15 16:53:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93263

markeggleston at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |markeggleston at gcc dot gnu.org

--- Comment #4 from markeggleston at gcc dot gnu.org ---
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 6f2a4c4d65a..4c009a65287 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -17079,6 +17079,7 @@ resolve_types (gfc_namespace *ns)
   gfc_data *d;
   gfc_equiv *eq;
   gfc_namespace* old_ns = gfc_current_ns;
+  bool recursive = ns->proc_name && ns->proc_name->attr.recursive;

   if (ns->types_resolved)
     return;
@@ -17132,7 +17133,7 @@ resolve_types (gfc_namespace *ns)

   gfc_traverse_ns (ns, resolve_values);

-  if (ns->save_all || !flag_automatic)
+  if (!recursive && (ns->save_all || !flag_automatic))
     gfc_save_all (ns);

   iter_stack = NULL;

Does the trick. Now need to write the test cases and prepare a patch.


More information about the Gcc-bugs mailing list