public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-3233] Fortran - fix whitespace issue during parsing of assigned goto
Date: Mon, 30 Aug 2021 21:10:27 +0000 (GMT)	[thread overview]
Message-ID: <20210830211027.5AFBD3858D34@sourceware.org> (raw)

https://gcc.gnu.org/g:a7083b83e45852540a4a09ee11b74dc28d777399

commit r12-3233-ga7083b83e45852540a4a09ee11b74dc28d777399
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Aug 30 23:07:56 2021 +0200

    Fortran - fix whitespace issue during parsing of assigned goto
    
    gcc/fortran/ChangeLog:
    
            PR fortran/102113
            * match.c (gfc_match_goto): Allow for whitespace in parsing list
            of labels.
    
    gcc/testsuite/ChangeLog:
    
            PR fortran/102113
            * gfortran.dg/goto_9.f90: New test.

Diff:
---
 gcc/fortran/match.c                  |  2 +-
 gcc/testsuite/gfortran.dg/goto_9.f90 | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 16502da001d..53a575e616e 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4079,7 +4079,7 @@ gfc_match_goto (void)
 	}
       while (gfc_match_char (',') == MATCH_YES);
 
-      if (gfc_match (")%t") != MATCH_YES)
+      if (gfc_match (" )%t") != MATCH_YES)
 	goto syntax;
 
       if (head == NULL)
diff --git a/gcc/testsuite/gfortran.dg/goto_9.f90 b/gcc/testsuite/gfortran.dg/goto_9.f90
new file mode 100644
index 00000000000..e05e73819e6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goto_9.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+! PR fortran/102113 - parsing error in assigned goto
+
+program p
+   assign 10 to i
+   goto i,(10,20 )
+10 continue
+20 continue
+end


                 reply	other threads:[~2021-08-30 21:10 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=20210830211027.5AFBD3858D34@sourceware.org \
    --to=anlauf@gcc.gnu.org \
    --cc=gcc-cvs@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).