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

--- Comment #5 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:6df8dcec7196e42ca2eed69e1ae455bae8d0fe93

commit r14-3485-g6df8dcec7196e42ca2eed69e1ae455bae8d0fe93
Author: Andrew Pinski <apin...@marvell.com>
Date:   Sat Aug 19 17:56:46 2023 -0700

    MATCH: `a | C -> C` when we know that `a & ~C == 0`

    Even though this is handled by other code inside both VRP and CCP,
    sometimes we want to optimize this outside of VRP and CCP.
    An example is given in PR 106677 where phiopt will happen
    after VRP (which removes a cast for a comparison) and then
    phiopt will optimize the phi to be `a | 1` which can then
    be optimized to `1` due to this patch.

    OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

    Note Similar code already exists in simplify_rtx for the RTL level;
    it was moved from combine to simplify_rtx in r0-72539-gbd1ef757767f6d.
    gcc/ChangeLog:

            * match.pd (`a | C -> C`): New pattern.

Reply via email to