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

--- Comment #13 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:71b68cc559b5d30d07e6b507df7cc6d008f56aad

commit r14-2299-g71b68cc559b5d30d07e6b507df7cc6d008f56aad
Author: Andrew Pinski <apin...@marvell.com>
Date:   Fri Jun 30 19:22:48 2023 -0700

    PR 110487: `(a !=/== CST1 ? CST2 : CST3)` pattern for type safety

    The problem here is we might produce some values out of the type's
    min/max (and/or valid values, e.g. signed booleans). The fix is to
    use an integer type which has the same precision and signedness
    as the original type.

    Note two_value_replacement in phiopt had the same issue in previous
    versions; though I don't know if a problem will show up there.

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

    gcc/ChangeLog:

            PR tree-optimization/110487
            * match.pd (a !=/== CST1 ? CST2 : CST3): Always
            build a nonstandard integer and use that.

Reply via email to