https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109500
--- Comment #9 from anlauf at gcc dot gnu.org --- The following patch rejects the code in comment#0 and regtests ok: diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc index e9843e9549c..64a54c06800 100644 --- a/gcc/fortran/interface.cc +++ b/gcc/fortran/interface.cc @@ -2195,6 +2214,8 @@ compare_allocatable (gfc_symbol *formal, gfc_expr *actual) return true; else if (!attr.allocatable) return false; + else if (actual->expr_type != EXPR_VARIABLE) + return false; } return true;