https://gcc.gnu.org/g:c980e8a7203a4e85cd271fe174e3f23f59a6faac
commit c980e8a7203a4e85cd271fe174e3f23f59a6faac 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 906f5316755b..6cb2edeb66eb 100644 --- a/gcc/tree-ssa-ifcombine.cc +++ b/gcc/tree-ssa-ifcombine.cc @@ -985,6 +985,10 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool inner_inv, single_pred (inner_cond_bb) != outer_cond_bb ? &ts : 0)))) { + /* 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)