From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3928D3858C55; Thu, 13 Oct 2022 21:39:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3928D3858C55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665697167; bh=AYyHCLLG/BAB0C9pH6aQ43DXJuMoJx5JUx8s28+ZW4E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iHQNC2+DcyRC7T3AVk9iYEnx4/vvG+eEwTgwgwHL3mWeO/l7XKa0Kbx9ltrL05i7U XfPn5/36SwKvl8EVmkyRp3FXRbSis/Cizg6ybM4grWF8ZhhdwULjBnBKkfY1U+/ABa SMDrorjnikKwFkOVBRfKBj9iUTeUYBAkwIj4J/sY= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/93483] ICE in gfc_constructor_copy, at fortran/constructor.c:103 Date: Thu, 13 Oct 2022 21:39:26 +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: sgk at troutmask dot apl.washington.edu 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 #16 from Steve Kargl = --- On Thu, Oct 13, 2022 at 08:56:55PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93483 >=20 > --- Comment #15 from anlauf at gcc dot gnu.org --- > (In reply to anlauf from comment #14) > > Is it conceivable that a somewhat weaker form of simplification, which > > addresses the parentheses as well as the basic unary and binary operato= rs > > could still be used for the time being? > >=20 > > There is simplify_intrinsic_op; it just needs to be made non-static. > > And seems to work here, also for Mikael's example. > >=20 > > So on top of the posted patch, >=20 > Argh, this doesn't work. My fault. >=20 gfc_simplify_expr will call simplify_intrinsic_op. Thisi, I think, leads to arith.cc:gfc_uplus and arith.cc:gfc_parentheses. These simply copy the expression to a new expression without trying to reduce the expression, and then returns. For unary plus, instead of copying the expression, gfortran could copy the operand. For parentheses, one would need to walk the expression to see if it can be reduced.=