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/99840] [9/10/11 Regression] ICE in gfc_simplify_matmul,  at fortran/simplify.c:4777
Date: Tue, 30 Mar 2021 20:05:30 +0000	[thread overview]
Message-ID: <bug-99840-4-Aq6GN9U1aw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99840-4@http.gcc.gnu.org/bugzilla/>

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

kargl at gcc dot gnu.org changed:

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

--- Comment #2 from kargl at gcc dot gnu.org ---
Patch.  Check if a or b is zero-sized.

diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 388aca7c38c..6c5259c648d 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4728,7 +4728,9 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr
*matrix_b)
   int stride_a, offset_a, stride_b, offset_b;

   if (!is_constant_array_expr (matrix_a)
-      || !is_constant_array_expr (matrix_b))
+      || gfc_is_size_zero_array (matrix_a)
+      || !is_constant_array_expr (matrix_b)
+      || gfc_is_size_zero_array (matrix_b))
     return NULL;

   /* MATMUL should do mixed-mode arithmetic.  Set the result type.  */

  parent reply	other threads:[~2021-03-30 20:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 19:13 [Bug fortran/99840] New: " gscfq@t-online.de
2021-03-30 19:53 ` [Bug fortran/99840] " anlauf at gcc dot gnu.org
2021-03-30 20:05 ` kargl at gcc dot gnu.org [this message]
2021-03-31  8:10 ` rguenth at gcc dot gnu.org
2021-03-31 12:54 ` marxin at gcc dot gnu.org
2021-03-31 20:38 ` anlauf at gcc dot gnu.org
2021-03-31 20:51 ` anlauf at gcc dot gnu.org
2021-03-31 21:07 ` sgk at troutmask dot apl.washington.edu
2021-03-31 21:11 ` anlauf at gmx dot de
2021-03-31 21:12 ` anlauf at gcc dot gnu.org
2021-04-01  5:50 ` cvs-commit at gcc dot gnu.org
2021-04-01  6:15 ` cvs-commit at gcc dot gnu.org
2021-04-02 18:54 ` cvs-commit at gcc dot gnu.org
2021-04-02 19:02 ` cvs-commit at gcc dot gnu.org
2021-04-02 19:03 ` 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-99840-4-Aq6GN9U1aw@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).