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

--- Comment #2 from anlauf at gcc dot gnu.org ---
The patch

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index a210f9aad43..096108f4317 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -16476,6 +16507,7 @@ gfc_impure_variable (gfc_symbol *sym)

   proc = sym->ns->proc_name;
   if (sym->attr.dummy
+      && !sym->attr.value
       && ((proc->attr.subroutine && sym->attr.intent == INTENT_IN)
          || proc->attr.function))
     return 1;

regtests fine.  Not sure if this is the best solution, since older
Fortran standards seemed to require INTENT(IN) for dummy x, while
F2018 forbids INTENT(INOUT) and INTENT(OUT), as well as ALLOCATABLE,
POINTER and VOLATILE here.

Reply via email to