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/108434] [12/13 Regression] ICE in class_allocatable, at fortran/expr.cc:5000
Date: Sun, 19 Mar 2023 21:23:40 +0000	[thread overview]
Message-ID: <bug-108434-4-ViIkHPO9bL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108434-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #6)
> There is another potential issue (see comment#1) which might be related
> to this one or not.  Keeping this PR open until the finalization work
> reaches the next stage...

The variant from comment#1 first hits a NULL pointer dereference fixed by:

diff --git a/gcc/fortran/class.cc b/gcc/fortran/class.cc
index bffc0ffff3a..0436db82020 100644
--- a/gcc/fortran/class.cc
+++ b/gcc/fortran/class.cc
@@ -940,7 +940,7 @@ comp_is_finalizable (gfc_component *comp)
               || (comp->ts.u.derived->f2k_derived
                   && comp->ts.u.derived->f2k_derived->finalizers)))
     return true;
-  else if (comp->ts.type == BT_CLASS && CLASS_DATA (comp)
+  else if (comp->ts.type == BT_CLASS && comp->attr.class_ok && CLASS_DATA
(comp)
            && CLASS_DATA (comp)->attr.allocatable)
     return true;
   else

but afterwards generates a traceback in generate_finalization_wrapper:

pr108434-aa.f90:8:35:

    8 |      class(c), allocatable :: a(2) ! { dg-error "must have a deferred
shape" }
      |                                   1
Error: Allocatable component of structure at (1) must have a deferred shape
f951: internal compiler error: in generate_finalization_wrapper, at
fortran/class.cc:1714
0x8e10e1 generate_finalization_wrapper
        ../../gcc-trunk/gcc/fortran/class.cc:1714
0x8e4396 gfc_find_derived_vtab(gfc_symbol*)
        ../../gcc-trunk/gcc/fortran/class.cc:2618
0x9abfb8 resolve_fl_derived
        ../../gcc-trunk/gcc/fortran/resolve.cc:15482
0x9ad0af resolve_symbol
        ../../gcc-trunk/gcc/fortran/resolve.cc:15867
0x9d78d8 do_traverse_symtree
        ../../gcc-trunk/gcc/fortran/symbol.cc:4196
0x9d7996 gfc_traverse_ns(gfc_namespace*, void (*)(gfc_symbol*))
        ../../gcc-trunk/gcc/fortran/symbol.cc:4221
0x9b1f95 resolve_types
        ../../gcc-trunk/gcc/fortran/resolve.cc:17830
0x9b2446 gfc_resolve(gfc_namespace*)
        ../../gcc-trunk/gcc/fortran/resolve.cc:17945
0x97f916 resolve_all_program_units
        ../../gcc-trunk/gcc/fortran/parse.cc:6655
0x980112 gfc_parse_file()
        ../../gcc-trunk/gcc/fortran/parse.cc:6911
0x9e779f gfc_be_parse_file
        ../../gcc-trunk/gcc/fortran/f95-lang.cc:229

  parent reply	other threads:[~2023-03-19 21:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 17:45 [Bug fortran/108434] New: " gscfq@t-online.de
2023-01-17 20:01 ` [Bug fortran/108434] " anlauf at gcc dot gnu.org
2023-01-18  8:46 ` marxin at gcc dot gnu.org
2023-01-18  8:58 ` rguenth at gcc dot gnu.org
2023-01-18 21:21 ` anlauf at gcc dot gnu.org
2023-01-19 18:23 ` cvs-commit at gcc dot gnu.org
2023-01-23 21:30 ` cvs-commit at gcc dot gnu.org
2023-01-23 21:39 ` anlauf at gcc dot gnu.org
2023-03-19 21:23 ` anlauf at gcc dot gnu.org [this message]
2023-05-08 12:26 ` [Bug fortran/108434] [12/13/14 " rguenth 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-108434-4-ViIkHPO9bL@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).