[gcc r17-3044] tree-optimization: Remove dead code. [PR126669]

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

commit r17-3044-g38bc78f593488bb1a28ca6b20e538f378113392d
Author: Kael Andrew Alonzo Franco <[email protected]>
Date:   Thu Aug 6 19:52:46 2026 -0400

    tree-optimization: Remove dead code. [PR126669]
    
    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/126669
    
    gcc/ChangeLog:
    
            * tree-ssa-strlen.cc (use_in_zero_equality): Remove dead code.
    
    Signed-off-by: Kael Andrew Franco <[email protected]>

Diff:
---
 gcc/tree-ssa-strlen.cc | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc
index d6949441f316..8e2550f553a1 100644
--- a/gcc/tree-ssa-strlen.cc
+++ b/gcc/tree-ssa-strlen.cc
@@ -3995,19 +3995,7 @@ use_in_zero_equality (tree res, bool exclusive)
       if (gimple_code (use_stmt) == GIMPLE_ASSIGN)
 	{
 	  tree_code code = gimple_assign_rhs_code (use_stmt);
-	  if (code == COND_EXPR)
-	    {
-	      tree cond_expr = gimple_assign_rhs1 (use_stmt);
-	      if ((TREE_CODE (cond_expr) != EQ_EXPR
-		   && (TREE_CODE (cond_expr) != NE_EXPR))
-		  || !integer_zerop (TREE_OPERAND (cond_expr, 1)))
-		{
-		  if (exclusive)
-		    return NULL;
-		  continue;
-		}
-	    }
-	  else if (code == EQ_EXPR || code == NE_EXPR)
+	  if (code == EQ_EXPR || code == NE_EXPR)
 	    {
 	      if (!integer_zerop (gimple_assign_rhs2 (use_stmt)))
 		{
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.