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

--- Comment #14 from GCC 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:59ecd5ff096f800de17b804f1482055f2d84d629

commit r14-6827-g59ecd5ff096f800de17b804f1482055f2d84d629
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Sun Dec 24 15:51:35 2023 -0800

    match: Improve `(a != b) ? (a + b) : (2 * a)` pattern [PR19832]

    In the testcase provided, we would match f_plus but not g_plus
    due to a missing `:c` on the plus operator. This fixes the oversight
    there.

    Note this was noted in https://github.com/llvm/llvm-project/issues/76318 .

    Committed as obvious after bootstrap/test on x86_64-linux-gnu.

            PR tree-optimization/19832

    gcc/ChangeLog:

            * match.pd (`(a != b) ? (a + b) : (2 * a)`): Add `:c`
            on the plus operator.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/phi-opt-same-2.c: New test.

    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>

Reply via email to