From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 288483858C3A; Thu, 1 Feb 2024 14:12:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 288483858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706796770; bh=H70qmAqh8KJChy0Ax+mbMD3bXZzY4SzZuPttb2MIs4s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uzMlwEpouLZLK0FXoQvX4n/KNdIAzougMkkXgGgJuZq4O+SyxnZWavPWBFr9ScOvU D8iuOU1qavLtQlmtT08HvaEdx7bmNwyq/GwmJ+EVIBrulHS4gYAHZbpChw9isO2vx3 g8Rat43Kb0zDIYm9FfkiW3RgVuKQ09yqXNUKhrhc= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113703] ivopts miscompiles loop Date: Thu, 01 Feb 2024 14:12:49 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords cc 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=3D113703 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code CC| |rguenth at gcc dot gnu.org --- Comment #1 from Richard Biener --- I think the point is we fail to represent Analyzing # of iterations of loop 1 exit condition [i_5(D) + 1, + , 1] < n_11(D) bounds on difference of bases: -18446744073709551615 ... 1844674407370955= 1615 result: zero if i_5(D) + 1 > n_11(D) # of iterations (n_11(D) - i_5(D)) + 18446744073709551615, bounded by 18446744073709551615 number of iterations (n_11(D) - i_5(D)) + 18446744073709551615; zero if i_5(D) + 1 > n_11(D) specifically the 'zero if i_5(D) + 1 > n_11(D)' I think may_eliminate_iv is wrong here, maybe not considering overflow of the niter expression? I wonder if it is possible to write a runtime testcase that FAILs with reasonable memory requirement/layout.=