From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 974933858409; Thu, 13 Jan 2022 07:13:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 974933858409 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/42436] VRP should mark non-trapping integer divisions Date: Thu, 13 Jan 2022 07:13:02 +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: 4.5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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: resolution bug_status 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: Thu, 13 Jan 2022 07:13:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D42436 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #4 from Richard Biener --- I think this was trying to cover things like if (d !=3D 0) tem =3D a / d; where the non-zero range of d on the division cannot be put in global ranges for its SSA name since that would be incorrect for uses not guarded by the condition. So it would ask for a new flag on GIMPLE statements to mark the division not trapping (like we have TREE_THIS_NOTRAP). Transforms like PRE or LIM that do code motion of course have to be careful to not move the stmt outside of the condition that made it not trapping - something whi= ch would be as hard to guarantee as computing the non-trappingness in the first place. So yes, the case that made me file this bug is fixed with global ranges. Let's close this bug since it's quite unspecific.=