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/105813] ICE in gfc_simplify_unpack, at fortran/simplify.cc:8490 Date: Thu, 02 Jun 2022 14:48:43 +0000 [thread overview] Message-ID: <bug-105813-4-kJfwqRGF7V@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105813-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105813 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-06-02 Ever confirmed|0 |1 Priority|P3 |P4 CC| |kargl at gcc dot gnu.org Status|UNCONFIRMED |NEW --- Comment #1 from kargl at gcc dot gnu.org --- Instead of an ICE on a user's invalid code, issue an actual error message. diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc index 233cc42137f..a962de2249a 100644 --- a/gcc/fortran/simplify.cc +++ b/gcc/fortran/simplify.cc @@ -8478,16 +8460,22 @@ gfc_simplify_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) vector_ctor = gfc_constructor_first (vector->value.constructor); mask_ctor = gfc_constructor_first (mask->value.constructor); - field_ctor - = field->expr_type == EXPR_ARRAY - ? gfc_constructor_first (field->value.constructor) - : NULL; + if (field->expr_type == EXPR_ARRAY) + field_ctor = gfc_constructor_first (field->value.constructor); + else + field_ctor = NULL; while (mask_ctor) { if (mask_ctor->expr->value.logical) { - gcc_assert (vector_ctor); + if (!vector_ctor) + { + gfc_error ("Size of vector at %L must be as large as the count " + "of .true. values in mask at %L", &vector->where, + &mask->where); + return NULL; + } e = gfc_copy_expr (vector_ctor->expr); vector_ctor = gfc_constructor_next (vector_ctor); }
next prev parent reply other threads:[~2022-06-02 14:48 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-02 3:56 [Bug fortran/105813] New: " asolokha at gmx dot com 2022-06-02 14:48 ` kargl at gcc dot gnu.org [this message] 2022-06-23 21:18 ` [Bug fortran/105813] " anlauf at gcc dot gnu.org 2022-06-23 22:07 ` sgk at troutmask dot apl.washington.edu 2022-06-24 20:29 ` cvs-commit at gcc dot gnu.org 2022-06-26 20:30 ` anlauf at gcc dot gnu.org 2022-06-30 20:02 ` cvs-commit at gcc dot gnu.org 2022-07-01 17:10 ` cvs-commit at gcc dot gnu.org 2022-07-01 17:24 ` cvs-commit at gcc dot gnu.org 2022-07-01 17:26 ` 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-105813-4-kJfwqRGF7V@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).