public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikael at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/93483] ICE in gfc_constructor_copy, at fortran/constructor.c:103
Date: Fri, 14 Oct 2022 19:19:36 +0000	[thread overview]
Message-ID: <bug-93483-4-mZ6tKPtQV7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-93483-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Mikael Morin from comment #19)
> (In reply to Mikael Morin from comment #18)
> > (In reply to Mikael Morin from comment #17)
> > > And something similar for the rest of the test (the binary operators).
> > 
> > Like this:
> > 
> It doesn't work unfortunately:
> 
This one works:

diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc
index 5e96bb9658e..c51ae105387 100644
--- a/gcc/fortran/arith.cc
+++ b/gcc/fortran/arith.cc
@@ -1318,7 +1318,7 @@ reduce_binary_ac (arith (*eval) (gfc_expr *, gfc_expr *,
gfc_expr **),

       if (c->expr->expr_type == EXPR_CONSTANT)
         rc = eval (c->expr, op2, &r);
-      else if (c->expr->expr_type == EXPR_OP && c->expr->ts.type ==
BT_UNKNOWN)
+      else if (c->expr->expr_type != EXPR_ARRAY)
        rc = ARITH_INVALID_TYPE;
       else
        rc = reduce_binary_ac (eval, c->expr, op2, &r);
@@ -1372,7 +1372,7 @@ reduce_binary_ca (arith (*eval) (gfc_expr *, gfc_expr *,
gfc_expr **),

       if (c->expr->expr_type == EXPR_CONSTANT)
        rc = eval (op1, c->expr, &r);
-      else if (c->expr->expr_type == EXPR_OP && c->expr->ts.type ==
BT_UNKNOWN)
+      else if (c->expr->expr_type != EXPR_ARRAY)
        rc = ARITH_INVALID_TYPE;
       else
        rc = reduce_binary_ca (eval, op1, c->expr, &r);
@@ -1433,8 +1433,8 @@ reduce_binary_aa (arith (*eval) (gfc_expr *, gfc_expr *,
gfc_expr **),
        c && d;
        c = gfc_constructor_next (c), d = gfc_constructor_next (d))
     {
-      if ((c->expr->expr_type == EXPR_OP && c->expr->ts.type == BT_UNKNOWN)
-         || (d->expr->expr_type == EXPR_OP && d->expr->ts.type == BT_UNKNOWN))
+      if ((!(c->expr->expr_type == EXPR_CONSTANT || c->expr->expr_type ==
EXPR_ARRAY))
+         || (!(d->expr->expr_type == EXPR_CONSTANT || d->expr->expr_type ==
EXPR_ARRAY)))
        rc = ARITH_INVALID_TYPE;
       else
        rc = reduce_binary (eval, c->expr, d->expr, &r);

  parent reply	other threads:[~2022-10-14 19:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-93483-4@http.gcc.gnu.org/bugzilla/>
2020-12-06 22:13 ` anlauf at gcc dot gnu.org
2020-12-07 21:52 ` anlauf at gcc dot gnu.org
2022-10-11 16:59 ` gscfq@t-online.de
2022-10-12 19:46 ` anlauf at gcc dot gnu.org
2022-10-13 16:35 ` kargl at gcc dot gnu.org
2022-10-13 18:43 ` anlauf at gcc dot gnu.org
2022-10-13 18:52 ` sgk at troutmask dot apl.washington.edu
2022-10-13 19:09 ` anlauf at gcc dot gnu.org
2022-10-13 19:26 ` sgk at troutmask dot apl.washington.edu
2022-10-13 19:35 ` mikael at gcc dot gnu.org
2022-10-13 19:55 ` anlauf at gcc dot gnu.org
2022-10-13 20:02 ` sgk at troutmask dot apl.washington.edu
2022-10-13 20:29 ` anlauf at gcc dot gnu.org
2022-10-13 20:56 ` anlauf at gcc dot gnu.org
2022-10-13 21:39 ` sgk at troutmask dot apl.washington.edu
2022-10-14 19:06 ` mikael at gcc dot gnu.org
2022-10-14 19:13 ` mikael at gcc dot gnu.org
2022-10-14 19:14 ` mikael at gcc dot gnu.org
2022-10-14 19:19 ` mikael at gcc dot gnu.org [this message]
2022-10-14 19:24 ` anlauf at gcc dot gnu.org
2022-10-14 20:14 ` anlauf at gcc dot gnu.org
2022-10-14 21:21 ` anlauf at gcc dot gnu.org
2022-10-15  9:28 ` mikael at gcc dot gnu.org
2022-10-15 13:55 ` anlauf at gcc dot gnu.org
2022-10-15 13:56 ` anlauf at gcc dot gnu.org
2022-10-15 17:38 ` mikael at gcc dot gnu.org
2022-10-15 19:56 ` anlauf at gcc dot gnu.org
2022-10-17 17:26 ` cvs-commit at gcc dot gnu.org
2022-10-17 17:39 ` 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-93483-4-mZ6tKPtQV7@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).