https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107145
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Priority|P3 |P4 Last reconfirmed| |2024-08-20 --- Comment #1 from anlauf at gcc dot gnu.org --- The following patch breaks the recursion: diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc index b592fe4f6c7..80c7239eec7 100644 --- a/gcc/fortran/interface.cc +++ b/gcc/fortran/interface.cc @@ -1384,6 +1396,10 @@ gfc_check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2, return false; } + /* Short-cut for same symbols. */ + if (s1 == s2) + return true; + /* Check type and rank. */ if (type_must_agree) { However, we then miss the circular dependency, which is detected by NAG: NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7200 Warning: pr107145.f90, line 9: Unused dummy procedure P2 Error: pr107145.f90, line 8: Named interface P for entity P2 depends on P2 itself via SUB Errors in declarations, no further processing for CIRCULAR