From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADD13385E838; Mon, 8 Jan 2024 10:02:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADD13385E838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704708141; bh=vyegX2LaddW5F/aSLkPaI0FruEbf9+7OmLwTx0k3vdI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b3LWRh/SojFvyRCk5c2cIYX6mlZ6tPkI9bk9VctoWHFh6tlr/KvjiGv3CgVDU+Gb/ hNneJCDs7sT11jmS1OnMGihglLrdTVyJ9eT0qGI01IQDrbThMscillqp8LAYFCdZS1 21e9/ee160Q4/ik9CWJc+7KmnMEdUtCiUyPPVyJE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113210] [14 Regression] ICE: tree check: expected integer_cst, have cond_expr in get_len, at tree.h:6481 Date: Mon, 08 Jan 2024 10:02:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D113210 --- Comment #10 from Jakub Jelinek --- (In reply to Richard Biener from comment #9) > I think we want to keep the invariant that both are INTEGER_CST when one = is. >=20 > If we can fold the add to 1 why can't we fold the original to 0? Because fold generally isn't recursive, so either whatever created the expression (niters analysis) would need to try to fold all subexpressions w= hich it clearly doesn't try to do so, or we rely on luck that something changed = and we fold something because of that, which is exactly what triggers it during= the + 1 folding.=