Re: [PATCH 5/5] tree-optimization: Remove dead code in tree-ssa-forwprop.cc. [PR120582]

Andrea Pinski <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <CALvbMcDTRVQ89TPzU4wYeqcTHgUCK+MwTCTWOcQqjzXQ97h2KQ@mail.gmail.com>
On Thu, Aug 13, 2026 at 9:20 AM Kael Andrew Alonzo Franco
<[email protected]> wrote:
>
> This is dead since COND_EXPR is always a SSA_NAME or a constant.
>
> Bootstrapped and regtested on x86_64-pc-linux-gnu.
>
>         PR tree-optimization/120582
>
> gcc/ChangeLog:
>
>         * tree-ssa-forwprop.cc (simplify_builtin_call): Remove dead code.

Ok.

>
> Signed-off-by: Kael Andrew Franco <[email protected]>
> ---
>  gcc/tree-ssa-forwprop.cc | 18 ------------------
>  1 file changed, 18 deletions(-)
>
> diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc
> index 0531311444b..55bd8aee5f8 100644
> --- a/gcc/tree-ssa-forwprop.cc
> +++ b/gcc/tree-ssa-forwprop.cc
> @@ -2637,16 +2637,6 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2, bool full_walk
>                   crhs1 = gimple_assign_rhs1 (use_stmt);
>                   crhs2 = gimple_assign_rhs2 (use_stmt);
>                 }
> -             else if (gimple_assign_rhs_code (use_stmt) == COND_EXPR)
> -               {
> -                 tree cond = gimple_assign_rhs1 (use_stmt);
> -                 if (COMPARISON_CLASS_P (cond))
> -                   {
> -                     ccode = TREE_CODE (cond);
> -                     crhs1 = TREE_OPERAND (cond, 0);
> -                     crhs2 = TREE_OPERAND (cond, 1);
> -                   }
> -               }
>             }
>           if (ccode == EQ_EXPR || ccode == NE_EXPR)
>             {
> @@ -2754,14 +2744,6 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2, bool full_walk
>                       gimple_assign_set_rhs1 (use_stmt, crhs1);
>                       gimple_assign_set_rhs2 (use_stmt, crhs2);
>                     }
> -                 else
> -                   {
> -                     gcc_checking_assert (gimple_assign_rhs_code (use_stmt)
> -                                          == COND_EXPR);
> -                     tree cond = build2 (ccode, boolean_type_node,
> -                                         crhs1, crhs2);
> -                     gimple_assign_set_rhs1 (use_stmt, cond);
> -                   }
>                 }
>               update_stmt (use_stmt);
>               if (atomic_op != BIT_AND_EXPR
> --
> 2.55.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.