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/103692] [11/12 Regression] ICE in add_init_expr_to_sym,  at fortran/decl.c:2062
Date: Mon, 17 Jan 2022 21:02:09 +0000	[thread overview]
Message-ID: <bug-103692-4-XznnaDsWyo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103692-4@http.gcc.gnu.org/bugzilla/>

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #4 from anlauf at gcc dot gnu.org ---
We need to handle zero-sized constructors.

Tentative patch:

diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 472304326e8..f1d92e00c98 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -1883,6 +1883,9 @@ gfc_expand_constructor (gfc_expr *e, bool fatal)
   gfc_expr *f;
   bool rc;

+  if (gfc_is_size_zero_array (e))
+    return true;
+
   /* If we can successfully get an array element at the max array size then
      the array is too big to expand, so we just return.  */
   f = gfc_get_array_element (e, flag_max_array_constructor);

  parent reply	other threads:[~2022-01-17 21:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 19:52 [Bug fortran/103692] New: " gscfq@t-online.de
2021-12-13 20:38 ` [Bug fortran/103692] " anlauf at gcc dot gnu.org
2021-12-13 21:23 ` anlauf at gcc dot gnu.org
2021-12-14 10:07 ` marxin at gcc dot gnu.org
2022-01-04 11:08 ` rguenth at gcc dot gnu.org
2022-01-17 21:02 ` anlauf at gcc dot gnu.org [this message]
2022-01-17 21:59 ` anlauf at gcc dot gnu.org
2022-01-18 19:02 ` cvs-commit at gcc dot gnu.org
2022-01-20 21:59 ` cvs-commit at gcc dot gnu.org
2022-01-20 22:47 ` cvs-commit at gcc dot gnu.org
2022-01-20 22:48 ` 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-103692-4-XznnaDsWyo@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).