https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105832
--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:b34f373635635fa331d2803d9232b3cfd4fd4fd1 commit r14-3719-gb34f373635635fa331d2803d9232b3cfd4fd4fd1 Author: Andrew Pinski <apin...@marvell.com> Date: Sun Sep 3 06:04:41 2023 +0000 MATCH: Transform `(1 >> X) !=/== 0` into `X ==/!= 0` We currently have a pattern for handling `(C >> X) & D == 0` but if C is 1 and D is 1, the `& 1` might have been removed. gcc/ChangeLog: PR tree-optimization/105832 * match.pd (`(1 >> X) != 0`): New pattern gcc/testsuite/ChangeLog: PR tree-optimization/105832 * gcc.dg/tree-ssa/pr105832-1.c: New test. * gcc.dg/tree-ssa/pr105832-2.c: New test. * gcc.dg/tree-ssa/pr105832-3.c: New test.