https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111456

--- Comment #7 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:c3c6f30496d945b77dcb7f4ad8c3f8094f5a64a4

commit r14-4280-gc3c6f30496d945b77dcb7f4ad8c3f8094f5a64a4
Author: Andrew Pinski <apin...@marvell.com>
Date:   Wed Sep 20 14:54:31 2023 -0700

    MATCH: Simplify `(A ==/!= B) &/| (((cast)A) CMP C)`

    This patch adds support to the pattern for `(A == B) &/| (A CMP C)`
    where the second A could be casted to a different type.
    Some were handled correctly if using seperate `if` statements
    but not if combined with BIT_AND/BIT_IOR.
    In the case of pr111456-1.c, the testcase would pass if
    `--param=logical-op-non-short-circuit=0` was used but now
    can be optimized always.

    OK? Bootstrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/106164
            PR tree-optimization/111456

    gcc/ChangeLog:

            * match.pd (`(A ==/!= B) & (A CMP C)`):
            Support an optional cast on the second A.
            (`(A ==/!= B) | (A CMP C)`): Likewise.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/cmpbit-6.c: New test.
            * gcc.dg/tree-ssa/cmpbit-7.c: New test.
            * gcc.dg/tree-ssa/pr111456-1.c: New test.

Reply via email to