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

commit r16-627-gd8d3cb676949ea3c2af5ff2d4f6c5582ce7cc9f8
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Tue May 13 13:04:32 2025 -0700

    forwprop: Change an if into an assert
    
    Since the merge of the tuples branch (r0-88576-g726a989a8b74bf), the
    if:
    ```
      if (TREE_CODE_CLASS (gimple_cond_code (stmt)) != tcc_comparison)
    ```
    Will always be false so let's change it into an assert.
    
    gcc/ChangeLog:
    
            * tree-ssa-forwprop.cc (forward_propagate_into_gimple_cond): Assert
            that gimple_cond_code is always a comparison.
    
    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>

Diff:
---
 gcc/tree-ssa-forwprop.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc
index 4ec5b6a6ba1a..60b7c80e07c2 100644
--- a/gcc/tree-ssa-forwprop.cc
+++ b/gcc/tree-ssa-forwprop.cc
@@ -551,9 +551,8 @@ forward_propagate_into_gimple_cond (gcond *stmt)
   tree rhs1 = gimple_cond_lhs (stmt);
   tree rhs2 = gimple_cond_rhs (stmt);
 
-  /* We can do tree combining on SSA_NAME and comparison expressions.  */
-  if (TREE_CODE_CLASS (gimple_cond_code (stmt)) != tcc_comparison)
-    return 0;
+  /* GIMPLE_COND will always be a comparison.  */
+  gcc_assert (TREE_CODE_CLASS (gimple_cond_code (stmt)) == tcc_comparison);
 
   tmp = forward_propagate_into_comparison_1 (stmt, code,
                                             boolean_type_node,

Reply via email to