Re: [PATCH 2/5] tree-optimization: Remove dead code in gimple.cc. [PR120579]

Andrea Pinski <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <CALvbMcDjbSstk0mTPdow8WomQc_TG3ssts5uir3n=gOBGDSvdA@mail.gmail.com>
On Thu, Aug 13, 2026 at 9:19 AM Kael Andrew Alonzo Franco
<[email protected]> wrote:
>
> This is dead since COND_EXPR is always a SSA_NAME or a constant.

Ok.

>
> Bootstrapped and regtested on x86_64-pc-linux-gnu.
>
>         PR tree-optimization/120579
>
> gcc/ChangeLog:
>
>         * gimple.cc (gimple_could_trap_p_1): Remove dead code.
>
> Signed-off-by: Kael Andrew Franco <[email protected]>
> ---
>  gcc/gimple.cc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/gimple.cc b/gcc/gimple.cc
> index 648400aa444..3756a60a8e6 100644
> --- a/gcc/gimple.cc
> +++ b/gcc/gimple.cc
> @@ -2435,9 +2435,9 @@ gimple_could_trap_p_1 (const gimple *s, bool include_mem, bool include_stores)
>      case GIMPLE_ASSIGN:
>        op = gimple_assign_rhs_code (s);
>
> -      /* For COND_EXPR only the condition may trap.  */
> +      /* COND_EXPR does not trap.  */
>        if (op == COND_EXPR)
> -       return tree_could_trap_p (gimple_assign_rhs1 (s));
> +       return false;
>
>        /* For comparisons we need to check rhs operand types instead of lhs type
>           (which is BOOLEAN_TYPE).  */
> --
> 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.