From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 17E203858C52; Fri, 14 Oct 2022 19:24:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17E203858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665775462; bh=AS6lo9Ob8PL+xvnc0uBCikdgIQUH3RHiDGGbKFZ4vOE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IkzjdZlZ/nchmd1CCcq3noUcqQBlRlMYlWo4kUYv46N0QaBPx17ylanZx0tfCUa26 B3R+SUJRXjoiqM5WkA1Vf3SJP5HGv2bwa5eJxe/4YlwCuUSL+i6O+GECgD0bWDmH4L BsXzJNWU/V7JJgZ1l11ENC6+mTqslT9dqXLsb6LM= From: "anlauf 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:24:21 +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: anlauf 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 #21 from anlauf at gcc dot gnu.org --- (In reply to Mikael Morin from comment #17) > Like this for the first part of the test from the patch: >=20 > diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc > index 9e079e42995..5e96bb9658e 100644 > --- a/gcc/fortran/arith.cc > +++ b/gcc/fortran/arith.cc > @@ -1267,6 +1267,9 @@ reduce_unary (arith (*eval) (gfc_expr *, gfc_expr *= *), > gfc_expr *op, > if (op->expr_type =3D=3D EXPR_CONSTANT) > return eval (op, result); >=20=20 > + if (op->expr_type !=3D EXPR_ARRAY) > + return ARITH_INVALID_TYPE; > + > rc =3D ARITH_OK; > head =3D gfc_constructor_copy (op->value.constructor); > for (c =3D gfc_constructor_first (head); c; c =3D gfc_constructor_next= (c)) >=20 >=20 Yeah, I was getting just rather close to this one... This is probably the right way to go.=