diff mbox

[fortran] Bug 66575 - Endless compilation on missing end interface

Message ID 35205cc7-f75d-4b0d-23e7-63ef714be0f0@charter.net
State New
Headers show

Commit Message

Jerry DeLisle July 4, 2016, 9:01 p.m. UTC
This patch and test case regression tested on x86-64.

Will commit under simple/obvious rule.



2016-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/66575
	* decl.c (match_procedure_interface): Exit loop if procedure
	interface refers to itself.
diff mbox


diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 724f14f7..1b62833f 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -5454,7 +5454,8 @@  match_procedure_interface (gfc_symbol **proc_if)
       /* Resolve interface if possible. That way, attr.procedure is only set
 	 if it is declared by a later procedure-declaration-stmt, which is
 	 invalid per F08:C1216 (cf. resolve_procedure_interface).  */
-      while ((*proc_if)->ts.interface)
+      while ((*proc_if)->ts.interface
+	     && *proc_if != (*proc_if)->ts.interface)
 	*proc_if = (*proc_if)->ts.interface;
       if ((*proc_if)->attr.flavor == FL_UNKNOWN