From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2903E3864877; Thu, 11 Jan 2024 18:01:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2903E3864877 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704996111; bh=b4JR6wlNbKWPpGrk+ZuROuKCxZn71eWNSc/i/YZIVFA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hnt5tZkvokXEZpuc1Z9+KdLCB/EJDWHnofQV2BHGeXgA7cx7e96JnO7NFuOEr/CUe S5eSyyodrpreemBWgcV/0Hlz6wXvOWtgNDbzngYEBtoOSjKKgWTv+XsPyzeINTv67J PvexGi8ecUaP9gNu0v6vjPk9ryV795R7ssvV9cLQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113301] [12/13/14 Regression] Missed optimization: (1/(x+1))/2 => 0 since gcc-12 Date: Thu, 11 Jan 2024 18:01:50 +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: missed-optimization 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: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 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=3D113301 --- Comment #9 from GCC Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:7f56a90269b393fcc55ef08e0990fafb7b1c24b4 commit r14-7148-g7f56a90269b393fcc55ef08e0990fafb7b1c24b4 Author: Andrew Pinski Date: Wed Jan 10 14:25:37 2024 -0800 match: Delay folding of 1/x into `(x+1u)<2u?x:0` until late [PR113301] Since currently ranger does not work with the complexity of COND_EXPR in some cases so delaying the simplification of `1/x` for signed types help code generation. tree-ssa/divide-8.c is a new testcase where this can help. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/113301 gcc/ChangeLog: * match.pd (`1/x`): Delay signed case until late. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/divide-8.c: New test. Signed-off-by: Andrew Pinski =