This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


This patch and test case regression tested on x86-64.

Will commit under simple/obvious rule.

Regards,

Jerry

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 --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
! { dg-do compile }
! Bug 66575 - Endless compilation on missing end interface 
program p
   procedure(g) :: g ! { dg-error "may not be used as its own interface" }
   procedure(g) ! { dg-error "Syntax error in PROCEDURE statement" }
end

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]