https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114475
--- Comment #2 from anlauf at gcc dot gnu.org --- (In reply to Jürgen Reuter from comment #1) > I suspect this commit here, > https://gcc.gnu.org/git/?p=gcc.git;a=commit; > h=44c0398e65347def316700911a51ca8b4ec0a411 > but not totally certain. The following patch fixes the apparent regression: diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc index 9a042cd7040..68d16a9a378 100644 --- a/gcc/fortran/expr.cc +++ b/gcc/fortran/expr.cc @@ -3517,6 +3563,7 @@ check_restricted (gfc_expr *e) if (e->error || sym->attr.in_common || sym->attr.use_assoc + || sym->attr.used_in_submodule || sym->attr.dummy || sym->attr.implied_index || sym->attr.flavor == FL_PARAMETER Looks like the commit actually uncovered a latent issue. Mikael, do you want to follow up?