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/98458] PRINT the array constructed from implied do-loop throw ICE
Date: Mon, 28 Dec 2020 20:09:14 +0000	[thread overview]
Message-ID: <bug-98458-4-N2FdOfvAAM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98458-4@http.gcc.gnu.org/bugzilla/>

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org ---
Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c      (revision 1050250)
+++ gcc/fortran/simplify.c      (working copy)
@@ -6728,13 +6731,18 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shap
   bool zerosize = false;

   /* Check that argument expression types are OK.  */
-  if (!is_constant_array_expr (source)
-      || !is_constant_array_expr (shape_exp)
-      || !is_constant_array_expr (pad)
-      || !is_constant_array_expr (order_exp))
-    return NULL;
+  if (!is_constant_array_expr (source))
+    {
+      if (gfc_init_expr_flag && !gfc_reduce_init_expr (source))
+         return NULL;
+    }

   if (source->shape == NULL)
+    return NULL;
+
+  if (!is_constant_array_expr (shape_exp)
+      || !is_constant_array_expr (pad)
+      || !is_constant_array_expr (order_exp))
     return NULL;

   /* Proceed with simplification, unpacking the array.  */

  parent reply	other threads:[~2020-12-28 20:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28  4:20 [Bug fortran/98458] New: implied do-loop used in initialization with RESHAPE " xiao.liu@compiler-dev.com
2020-12-28 12:03 ` [Bug fortran/98458] PRINT the array constructed from implied do-loop " anlauf at gcc dot gnu.org
2020-12-28 13:26 ` dominiq at lps dot ens.fr
2020-12-28 20:09 ` kargl at gcc dot gnu.org [this message]
2020-12-29 17:28 ` pault at gcc dot gnu.org
2020-12-30  0:52 ` xiao.liu@compiler-dev.com
2020-12-30  2:19 ` sgk at troutmask dot apl.washington.edu
2020-12-30 13:40 ` [Bug fortran/98458] ICE in gfc_conv_array_initializer due to array expressions within implied do-loop pault at gcc dot gnu.org
2020-12-30 18:12 ` sgk at troutmask dot apl.washington.edu
2021-01-05 11:39 ` pault at gcc dot gnu.org
2021-01-08 10:11 ` cvs-commit at gcc dot gnu.org
2021-05-04 12:31 ` rguenth at gcc dot gnu.org
2023-10-31 17:19 ` pault 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-98458-4-N2FdOfvAAM@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).