From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 40B783858427; Wed, 23 Mar 2022 14:08:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 40B783858427 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104931] [9/10/11 Regression] wrong-code with number_of_iterations_lt_to_ne Date: Wed, 23 Mar 2022 14:08:08 +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.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth 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: Wed, 23 Mar 2022 14:08:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104931 --- Comment #11 from CVS Commits --- The releases/gcc-11 branch has been updated by Richard Biener : https://gcc.gnu.org/g:d1f4dfd409dedf4d00ca7be001cf757d0d6e82f4 commit r11-9688-gd1f4dfd409dedf4d00ca7be001cf757d0d6e82f4 Author: Richard Biener Date: Wed Mar 16 14:53:06 2022 +0100 tree-optimization/104931 - mitigate niter analysis issue The following backports a pointer associating pattern from trunk that mitigates an issue with number_of_iterations_lt_to_ne in which context we fail to fold a comparison but succeed in folding a related subtraction. In the failure mode this results in a loop wrongly assumed looping with a bogus number of iterations, resulting in crashing of the premake application on start. With the backported simplification we are able to fold the comparison and correctly compute the loop as not iterating. I have failed to create a standalone testcase. I belive part of the issue is still latent but I have failed to nail down the issue exactly. Still I believe the backporting of the mitigation patch is the most sensible and safe thing at this point. 2022-03-16 Richard Biener PR tree-optimization/104931 * match.pd ((ptr) (x p+ y) p+ z -> (ptr) (x p+ (y + z))): New GENERIC simplification.=