From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF7E33858C52; Fri, 14 Oct 2022 19:19:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF7E33858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665775176; bh=xdTEfkFh8qduhVjHAqXclcquyB9Kcmp6Kt7+oqDlvD8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kARguhUeqsNfCm9fK/EOhffWyMWGe6xS1kLG6H8kFlO1nSgv9Cdut3Mfdyv8qWPP5 USolIddZM1T5gWEmOqkeIbyS0Lw0hxOXU+wzE+Hjx2ORNP74XCv3BOR3ZpCh1kuWc7 mwOR7WIt91rGYydrttR+zSz8ZBB2EjaecFHRj374= From: "mikael at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: anlauf at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93483 --- Comment #20 from Mikael Morin --- (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). > >=20 > > Like this: > >=20 > It doesn't work unfortunately: >=20 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 =3D=3D EXPR_CONSTANT) rc =3D eval (c->expr, op2, &r); - else if (c->expr->expr_type =3D=3D EXPR_OP && c->expr->ts.type =3D=3D BT_UNKNOWN) + else if (c->expr->expr_type !=3D EXPR_ARRAY) rc =3D ARITH_INVALID_TYPE; else rc =3D 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 =3D=3D EXPR_CONSTANT) rc =3D eval (op1, c->expr, &r); - else if (c->expr->expr_type =3D=3D EXPR_OP && c->expr->ts.type =3D=3D BT_UNKNOWN) + else if (c->expr->expr_type !=3D EXPR_ARRAY) rc =3D ARITH_INVALID_TYPE; else rc =3D 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 =3D gfc_constructor_next (c), d =3D gfc_constructor_next (d)) { - if ((c->expr->expr_type =3D=3D EXPR_OP && c->expr->ts.type =3D=3D BT= _UNKNOWN) - || (d->expr->expr_type =3D=3D EXPR_OP && d->expr->ts.type =3D=3D = BT_UNKNOWN)) + if ((!(c->expr->expr_type =3D=3D EXPR_CONSTANT || c->expr->expr_type= =3D=3D EXPR_ARRAY)) + || (!(d->expr->expr_type =3D=3D EXPR_CONSTANT || d->expr->expr_ty= pe =3D=3D EXPR_ARRAY))) rc =3D ARITH_INVALID_TYPE; else rc =3D reduce_binary (eval, c->expr, d->expr, &r);=