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

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

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

commit r17-6322-gfba8d6538a4781d97c419c6d5f2a11c2c8eb66e1
Author: Andrea Pinski <[email protected]>
Date:   Thu Nov 12 22:45:53 2026 -0800

    phiopt: Remove unused statements in sequence before calling of
phiopt_early_allow

    Since match and simplify can add unused statements to the sequence
    in some cases, we should remove them before call phiopt_early_allow.
    This is needed for 2 future patches. One is to allowing of comparisons,
    optionally with a cast and optional with a negative expression.
    The other is about supporting a way to handling
    cond_removal_in_builtin_zero_pattern in match and also adding a new match
    pattern to fix PR 126035 (ctz split back into one).

    Bootstrapped and tested on x86_64-linux-gnu.

    Changes since v1:
    * v2: Use walk_gimple_op/walk_tree instead of assuming the operands
    are simple.
    * v3: Ignore the lhs inside the callback function.

    gcc/ChangeLog:

            * tree-ssa-phiopt.cc (remove_unused_stmts): New function.
            (gimple_simplify_phiopt): Call remove_unused_stmts before
            phiopt_early_allow.

    Signed-off-by: Andrea Pinski <[email protected]>

Reply via email to