https://gcc.gnu.org/g:3016f9380cb8fbb06ff37171954ceaf76586ed51

commit 3016f9380cb8fbb06ff37171954ceaf76586ed51
Author: Alexandre Oliva <ol...@gnu.org>
Date:   Thu Nov 21 22:40:45 2024 -0300

    skip fallback disjunction on noncontiguous ifcombine

Diff:
---
 gcc/tree-ssa-ifcombine.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc
index 9b9dc10cd220..51f37f15a9ef 100644
--- a/gcc/tree-ssa-ifcombine.cc
+++ b/gcc/tree-ssa-ifcombine.cc
@@ -974,6 +974,10 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool 
inner_inv,
                                            gimple_cond_rhs (outer_cond),
                                            gimple_bb (outer_cond))))
        {
+         /* Only combine conditions in this fallback case if the blocks are
+            neighbors.  */
+         if (single_pred (inner_cond_bb) != outer_cond_bb)
+           return false;
          tree t1, t2;
          bool logical_op_non_short_circuit = LOGICAL_OP_NON_SHORT_CIRCUIT;
          if (param_logical_op_non_short_circuit != -1)

Reply via email to