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/103794] ICE in gfc_check_reshape, at fortran/check.c:4727
Date: Tue, 21 Dec 2021 20:09:37 +0000	[thread overview]
Message-ID: <bug-103794-4-HI1Mys5Wts@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103794-4@http.gcc.gnu.org/bugzilla/>

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-12-21
                 CC|                            |anlauf at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.  We're not trying hard enough to simplify constant expressions
involving iterators.

The following fixes the testcases, but may not be the best/generic solution:

diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index b4db9337e9f..9f597ccb4b4 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "intrinsic.h"
 #include "constructor.h"
 #include "target-memory.h"
+#include "match.h"


 /* Reset a BOZ to a zero value.  This is used to prevent run-on errors
@@ -4721,6 +4722,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
     {
       gfc_expr *e;
       int i, extent;
+      gfc_reduce_init_expr (shape);
       for (i = 0; i < shape_size; ++i)
        {
          e = gfc_constructor_lookup_expr (shape->value.constructor, i);

  reply	other threads:[~2021-12-21 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 18:17 [Bug fortran/103794] New: " gscfq@t-online.de
2021-12-21 20:09 ` anlauf at gcc dot gnu.org [this message]
2023-05-21 20:50 ` [Bug fortran/103794] " anlauf at gcc dot gnu.org
2023-05-24 19:51 ` cvs-commit at gcc dot gnu.org
2023-05-25 17:14 ` 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-103794-4-HI1Mys5Wts@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).