From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 075C8385842A; Mon, 8 Jan 2024 09:44:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 075C8385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704707058; bh=EVlaVCUPzxnrYiKoNyHJqJWZ/9pTGKHVaFK7Fq7pSPQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IfGEZP90qgF6TUiPla5KBEilBFQmPDLFJptcLjxs7mMThxRQiVOmwI+UNnysqE5X3 M3DwHhHqWsd95coQfki2qbOSnuZjnIv9nmTdUPNX6fxaYzfWsjZ9tV9eXaK86faDoY ppsIWGZ2LAWvMZ5iBIw7U8YGSKFYO2YzWmUeEE1M= From: "rguenth 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 09:44:14 +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: rguenth 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 #9 from Richard Biener --- (In reply to Jakub Jelinek from comment #8) > Created attachment 56993 [details] > gcc14-pr113210.patch >=20 > So, I'd go with this patch (so far untested). I think we want to keep the invariant that both are INTEGER_CST when one is. If we can fold the add to 1 why can't we fold the original to 0? That is, another fix might be to adjust NITERSM1 to NITERS - 1 when NITERS went constant ... (btw, I want to get rid of _NITERS and only keep _NITERSM1 given _NITERS cannot be represented when the number of latch iterations is TYPE_MAX_VALUE)=