https://gcc.gnu.org/g:35b7781424058c74caf5f064048cd94df42c1166

commit 35b7781424058c74caf5f064048cd94df42c1166
Author: Alexandre Oliva <ol...@gnu.org>
Date:   Thu Nov 21 22:36:58 2024 -0300

    pass NULL separatep in adjacent blocks

Diff:
---
 gcc/gimple-fold.cc        | 1 -
 gcc/tree-ssa-ifcombine.cc | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index fe7fcf471d43..b579f9789c9d 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -7867,7 +7867,6 @@ reuse_split_load (tree /* in[0] out[1] */ ln_arg[2],
    single expression, even if it is a compound condition.  This must only be
    done if LHS and RHS are adjacent, without intervening conditions, and the
    combined condition is to replace RHS, while LHS is dropped altogether.
-   ??? This possibility is curently unused.
 
    Otherwise, SEPARATEP must be a non-NULL pointer to a NULL_TREE, that may be
    replaced by a part of the compound condition that could replace RHS, while
diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc
index 12a50eaaac3a..906f5316755b 100644
--- a/gcc/tree-ssa-ifcombine.cc
+++ b/gcc/tree-ssa-ifcombine.cc
@@ -982,7 +982,8 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool 
inner_inv,
                     inner_cond_code,
                     gimple_cond_lhs (inner_cond),
                     gimple_cond_rhs (inner_cond),
-                    &ts))))
+                    single_pred (inner_cond_bb) != outer_cond_bb
+                    ? &ts : 0))))
        {
          tree t1, t2;
          bool logical_op_non_short_circuit = LOGICAL_OP_NON_SHORT_CIRCUIT;

Reply via email to