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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu.org

--- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 486e5fafe51..f192f4444a4 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -2091,12 +2091,6 @@ resolve_actual_arglist (gfc_actual_arglist *arg,
procedure_type ptype,
          continue;
        }

-      if (e->expr_type == EXPR_VARIABLE
-           && e->symtree->n.sym->attr.generic
-           && no_formal_args
-           && count_specific_procs (e) != 1)
-       goto cleanup;
-
       if (e->ts.type != BT_PROCEDURE)
        {
          save_need_full_assumed_size = need_full_assumed_size;
@@ -2119,6 +2113,12 @@ resolve_actual_arglist (gfc_actual_arglist *arg,
procedure_type ptype,
          goto cleanup;
        }

+      if (e->expr_type == EXPR_VARIABLE
+           && sym->attr.generic
+           && no_formal_args
+           && count_specific_procs (e) != 1)
+       goto cleanup;
+
       if (sym->attr.flavor == FL_PROCEDURE
          || sym->attr.intrinsic
          || sym->attr.external)

I have not regression tested this yet but it does give an error on the test
case. Not the same as Intel.

Reply via email to