From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 63A25393D03C; Thu, 14 Jan 2021 11:51:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63A25393D03C From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96688] Failure to optimize shift-right/add+bitwise not of constant to avoid bitwise not Date: Thu, 14 Jan 2021 11:51:13 +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.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: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Thu, 14 Jan 2021 11:51:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96688 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:8f8762a2e8659c1db802ba001869085c1915498f commit r11-6663-g8f8762a2e8659c1db802ba001869085c1915498f Author: Jakub Jelinek Date: Thu Jan 14 12:50:33 2021 +0100 match.pd: Optimize ~(X >> Y) to ~X >> Y if ~X can be simplified [PR9668= 8] This patch optimizes two GIMPLE operations into just one. As mentioned in the PR, there is some risk this might create more expen= sive constants, but sometimes it will make them on the other side less expensive, it really depends on the exact value. And if it is an important issue, we should do it in md or during expans= ion. 2021-01-14 Jakub Jelinek PR tree-optimization/96688 * match.pd (~(X >> Y) -> ~X >> Y): New simplification if ~X can be simplified. * gcc.dg/tree-ssa/pr96688.c: New test. * gcc.dg/tree-ssa/reassoc-37.c: Adjust scan-tree-dump regex. * gcc.target/i386/pr66821.c: Likewise.=