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/104626] ICE in gfc_format_decoder, at fortran/error.cc:1071
Date: Mon, 21 Feb 2022 23:17:41 +0000	[thread overview]
Message-ID: <bug-104626-4-qwFGW5gyOM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104626-4@http.gcc.gnu.org/bugzilla/>

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
                 CC|                            |kargl at gcc dot gnu.org
   Last reconfirmed|                            |2022-02-21
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
NULL pointer deference.  While here, fix formatting.

diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
index 7a80dfd063b..a1580708f89 100644
--- a/gcc/fortran/symbol.cc
+++ b/gcc/fortran/symbol.cc
@@ -1299,9 +1299,8 @@ gfc_add_save (symbol_attribute *attr, save_state s, const
char *name,

   if (s == SAVE_EXPLICIT && gfc_pure (NULL))
     {
-      gfc_error
-       ("SAVE attribute at %L cannot be specified in a PURE procedure",
-        where);
+      gfc_error ("SAVE attribute at %L cannot be specified in a PURE "
+                "procedure", where);
       return false;
     }

@@ -1311,10 +1310,15 @@ gfc_add_save (symbol_attribute *attr, save_state s,
const char *name,
   if (s == SAVE_EXPLICIT && attr->save == SAVE_EXPLICIT
       && (flag_automatic || pedantic))
     {
-       if (!gfc_notify_std (GFC_STD_LEGACY,
-                            "Duplicate SAVE attribute specified at %L",
-                            where))
+      if (!where)
+       {
+         gfc_error ("Duplicate SAVE attribute specified near %C");
          return false;
+       }
+
+      if (!gfc_notify_std (GFC_STD_LEGACY, "Duplicate SAVE attribute "
+                          "specified at %L", where))
+       return false;
     }

   attr->save = s;

  reply	other threads:[~2022-02-21 23:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 21:33 [Bug fortran/104626] New: " gscfq@t-online.de
2022-02-21 23:17 ` kargl at gcc dot gnu.org [this message]
2023-05-29 23:57 ` [Bug fortran/104626] " kargl at gcc dot gnu.org
2023-10-13 20:12 ` jvdelisle 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-104626-4-qwFGW5gyOM@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).