public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/95613] ICE in main_block_label, at tree-cfg.c:1455
Date: Wed, 10 Jun 2020 05:48:02 +0000	[thread overview]
Message-ID: <bug-95613-4-kCQ9JspYtS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95613-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95613

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
           Priority|P3                          |P4

--- Comment #2 from kargl at gcc dot gnu.org ---
Fortran 66 has not been the standard for 54 years.  Time to enforce numbered
constraints in the Fortran 2018 (and older) standard.

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 280157)
+++ gcc/fortran/resolve.c       (working copy)
@@ -10193,12 +10200,16 @@ resolve_branch (gfc_st_label *label, gfc_code *code)
       return;
     }

-  /* The label is not in an enclosing block, so illegal.  This was
-     allowed in Fortran 66, so we allow it as extension.  No
-     further checks are necessary in this case.  */
-  gfc_notify_std (GFC_STD_LEGACY, "Label at %L is not in the same block "
-                 "as the GOTO statement at %L", &label->where,
-                 &code->loc);
+  /* F2018: C1169 (R1157) The label shall be the statement label of a
+     branch target statement that appears in the same inclusive scope
+     as the goto-stmt.
+
+     F2018: C1170 (R1158) Each label in label-list shall be the statement
+     label of a branch target statement that appears in the same inclusive
+     scope as the computed-goto-stmt.  */
+
+  gfc_error ("Label at %L is not in the same block as the GOTO statement "
+            "at %L", &label->where, &code->loc);
   return;
 }

  parent reply	other threads:[~2020-06-10  5:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 17:33 [Bug fortran/95613] New: " gscfq@t-online.de
2020-06-09 17:41 ` [Bug fortran/95613] " dominiq at lps dot ens.fr
2020-06-10  5:48 ` kargl at gcc dot gnu.org [this message]
2020-07-01 19:28 ` gscfq@t-online.de
2023-05-30  4:53 ` kargl at gcc dot gnu.org
2023-05-30  4:53 ` kargl at gcc dot gnu.org
2023-05-30  4:53 ` kargl at gcc dot gnu.org
2023-05-30  4:54 ` kargl at gcc dot gnu.org
2023-05-30  4:54 ` kargl at gcc dot gnu.org

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=bug-95613-4-kCQ9JspYtS@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).