https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101541
--- Comment #9 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:c7609acb8a8210188d21b2cd72ecc6d3b2de2ab8 commit r14-4662-gc7609acb8a8210188d21b2cd72ecc6d3b2de2ab8 Author: Andrew Pinski <pins...@gmail.com> Date: Sun Oct 15 10:36:56 2023 -0700 MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p. This improves the `A CMP 0 ? A : -A` set of match patterns to use bitwise_equal_p which allows an nop cast between signed and unsigned. This allows catching a few extra cases which were not being caught before. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/101541 * match.pd (A CMP 0 ? A : -A): Improve using bitwise_equal_p. gcc/testsuite/ChangeLog: PR tree-optimization/101541 * gcc.dg/tree-ssa/phi-opt-36.c: New test. * gcc.dg/tree-ssa/phi-opt-37.c: New test.