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/106049] ICE in gfc_simplify_pack, at fortran/simplify.cc:6481 Date: Wed, 22 Jun 2022 19:51:45 +0000 [thread overview] Message-ID: <bug-106049-4-F61oVondh5@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106049-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106049 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org Ever confirmed|0 |1 Last reconfirmed| |2022-06-22 Status|UNCONFIRMED |NEW --- Comment #1 from anlauf at gcc dot gnu.org --- Confirmed. Error recovery issue while trying to simplify pack. The chain of bad declarations passes an invalid constructor for the ARRAY argument. The following patch solves the problem at hand: diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc index e8e3ec63669..c4ba2e615a1 100644 --- a/gcc/fortran/simplify.cc +++ b/gcc/fortran/simplify.cc @@ -6373,6 +6374,10 @@ gfc_simplify_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector) && !is_constant_array_expr (mask))) return NULL; + if (mask->expr_type == EXPR_ARRAY + && gfc_is_size_zero_array (mask) != gfc_is_size_zero_array (array)) + return NULL; + result = gfc_get_array_expr (array->ts.type, array->ts.kind, &array->where); if (array->ts.type == BT_DERIVED) result->ts.u.derived = array->ts.u.derived; Maybe there is a better solution.
next prev parent reply other threads:[~2022-06-22 19:51 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-21 18:52 [Bug fortran/106049] New: " gscfq@t-online.de 2022-06-22 19:51 ` anlauf at gcc dot gnu.org [this message] 2022-07-05 20:09 ` [Bug fortran/106049] " anlauf at gcc dot gnu.org 2022-07-05 20:33 ` anlauf at gcc dot gnu.org 2022-07-12 18:20 ` cvs-commit at gcc dot gnu.org 2022-07-12 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-106049-4-F61oVondh5@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: linkBe 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).