From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B8CA3858D3C; Mon, 24 Jan 2022 12:15:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B8CA3858D3C From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100740] [9/10/11/12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r9-4145-ga81e2c6240655f60 Date: Mon, 24 Jan 2022 12:15:31 +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: 11.1.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: amker at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2022 12:15:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100740 --- Comment #9 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:f1af8528d34418bc874ae9d993ee0dc3559972d2 commit r12-6844-gf1af8528d34418bc874ae9d993ee0dc3559972d2 Author: Richard Biener Date: Mon Jan 24 11:50:06 2022 +0100 tree-optimization/102131 - fix niter analysis wrt overflow This fixes the overflow issues seen with analyzing BASE0 + STEP0 cmp BASE1 + STEP1 as BASE0 + STEP0 - STEP1 cmp BASE1 by following the logic we have when simplifying comparisons. 2022-01-24 Richard Biener Jiufu Guo PR tree-optimization/100740 PR tree-optimization/101508 PR tree-optimization/101972 PR tree-optimization/102131 * tree-ssa-loop-niter.cc (number_of_iterations_cond): Properly constrain BASE0 + STEP0 cmp BASE1 + STEP1 to BASE0 + STEP0 - STEP1 cmp BASE1 transform. * gcc.dg/torture/pr100740.c: New testcase. * gcc.dg/torture/pr101508.c: Likewise. * gcc.dg/torture/pr101972.c: Likewise. * gcc.dg/torture/pr102131-1.c: Likewise. * gcc.dg/torture/pr102131-2.c: Likewise. * gcc.dg/torture/pr102131-3.c: Likewise. * gcc.dg/torture/pr102131-4.c: Likewise.=