public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/104332] [10/11/12/13 Regression] ICE in resolve_symbol, at fortran/resolve.cc:15815
Date: Wed, 08 Mar 2023 21:59:25 +0000	[thread overview]
Message-ID: <bug-104332-4-ZQediMwXqe@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104332-4@http.gcc.gnu.org/bugzilla/>

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #7 from anlauf at gcc dot gnu.org ---
This adjustment of the logic also fixes the ICE and the accepts-invalid:

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 2780c82c798..c7f42dd2a4d 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -15933,8 +15942,8 @@ resolve_symbol (gfc_symbol *sym)

       /* First, make sure the variable is declared at the
         module-level scope (J3/04-007, Section 15.3).  */
-      if (sym->ns->proc_name->attr.flavor != FL_MODULE &&
-          sym->attr.in_common == 0)
+      if (!(sym->ns->proc_name && sym->ns->proc_name->attr.flavor ==
FL_MODULE)
+         && sym->attr.in_common == 0)
        {
          gfc_error ("Variable %qs at %L cannot be BIND(C) because it "
                     "is neither a COMMON block nor declared at the "

  parent reply	other threads:[~2023-03-08 21:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 17:41 [Bug fortran/104332] New: [9/10/11/12 " gscfq@t-online.de
2022-02-01 17:42 ` [Bug fortran/104332] " gscfq@t-online.de
2022-02-01 19:14 ` kargl at gcc dot gnu.org
2022-02-01 20:04 ` kargl at gcc dot gnu.org
2022-02-01 20:04 ` kargl at gcc dot gnu.org
2022-02-01 20:53 ` sgk at troutmask dot apl.washington.edu
2022-02-02  7:12 ` rguenth at gcc dot gnu.org
2022-05-27  9:47 ` [Bug fortran/104332] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:47 ` jakub at gcc dot gnu.org
2023-03-08 21:59 ` anlauf at gcc dot gnu.org [this message]
2023-03-09 18:08 ` anlauf at gcc dot gnu.org
2023-03-10 17:56 ` cvs-commit at gcc dot gnu.org
2023-03-15 20:46 ` cvs-commit at gcc dot gnu.org
2023-03-17 20:40 ` cvs-commit at gcc dot gnu.org
2023-03-17 20:41 ` cvs-commit at gcc dot gnu.org
2023-03-17 20:42 ` anlauf 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-104332-4-ZQediMwXqe@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).