public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jerry DeLisle <jvdelisle@charter.net>
To: fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org
Subject: [patch, fortran] Bug 66575 - Endless compilation on missing end interface
Date: Mon, 04 Jul 2016 21:01:00 -0000	[thread overview]
Message-ID: <35205cc7-f75d-4b0d-23e7-63ef714be0f0@charter.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

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.


[-- Attachment #2: pr66575.diff --]
[-- Type: text/x-patch, Size: 634 bytes --]

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

[-- Attachment #3: pr66575.f90 --]
[-- Type: text/x-fortran, Size: 238 bytes --]

! { 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

                 reply	other threads:[~2016-07-04 21:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35205cc7-f75d-4b0d-23e7-63ef714be0f0@charter.net \
    --to=jvdelisle@charter.net \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).