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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:b3ade4e315e5bab56eced1e22eceabbf1a8f15c4

commit r17-1527-gb3ade4e315e5bab56eced1e22eceabbf1a8f15c4
Author: Kael Andrew Alonzo Franco <[email protected]>
Date:   Fri Jun 12 05:55:56 2026 -0400

    match: Optimize (~a) >> a to -1 for signed a [PR125707]

    For signed a, (~a) >> a is the same as ~(a>>a) which is ~0 aka -1.

    Bootstrapped and tested on x86_64-pc-linux-gnu

            PR tree-optimization/125707

    gcc/ChangeLog:

            PR tree-optimization/125707
            * match.pd: Add (~a) >> a to -1 for signed a.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/125707
            * gcc.dg/pr125707.c: New test.

    Signed-off-by: Kael Franco <[email protected]>

Reply via email to