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/104573] ICE in resolve_structure_cons, at fortran/resolve.cc:1299
Date: Wed, 16 Feb 2022 20:00:21 +0000	[thread overview]
Message-ID: <bug-104573-4-xn24FOBEb7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104573-4@http.gcc.gnu.org/bugzilla/>

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

kargl at gcc dot gnu.org changed:

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

--- Comment #1 from kargl at gcc dot gnu.org ---
Only want to access the components of a derived type if we have an actual
derived type.

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 835a4783718..ef274e05d4a 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -1296,7 +1296,7 @@ resolve_structure_cons (gfc_expr *expr, int init)
   if (expr->ref)
     comp = expr->ref->u.c.sym->components;
   else
-    comp = expr->ts.u.derived->components;
+    comp = expr->ts.type == BT_DERIVED ? expr->ts.u.derived->components :
NULL;

   for (; comp && cons; comp = comp->next, cons = gfc_constructor_next (cons))
     {

  reply	other threads:[~2022-02-16 20:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 17:35 [Bug fortran/104573] New: " gscfq@t-online.de
2022-02-16 20:00 ` kargl at gcc dot gnu.org [this message]
2022-02-16 20:10 ` [Bug fortran/104573] " anlauf at gcc dot gnu.org
2022-02-16 20:25 ` sgk at troutmask dot apl.washington.edu
2022-02-16 20:32 ` anlauf at gcc dot gnu.org
2022-02-16 20:39 ` sgk at troutmask dot apl.washington.edu
2022-02-16 20:59 ` anlauf at gcc dot gnu.org
2022-02-16 21:20 ` anlauf at gcc dot gnu.org
2022-03-02 18:23 ` cvs-commit at gcc dot gnu.org
2022-03-02 18:25 ` 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-104573-4-xn24FOBEb7@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).