[gcc r17-3271] tree-optimization: Remove dead code in tree-ssa-forwprop.cc. [PR120582]

Kael Andrew Franco via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:864a0748f3e9fdd1505a26002bd348a95ed3076a

commit r17-3271-g864a0748f3e9fdd1505a26002bd348a95ed3076a
Author: Kael Andrew Alonzo Franco <[email protected]>
Date:   Wed Aug 12 20:03:39 2026 -0400

    tree-optimization: Remove dead code in tree-ssa-forwprop.cc. [PR120582]
    
    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.
    
    Signed-off-by: Kael Andrew Franco <[email protected]>

Diff:
---
 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 0531311444b9..55bd8aee5f83 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
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.