PR rtl-optimization/80491
* ifcvt.c (noce_process_if_block): When looking for x setter
with missing else_bb, don't check only the insn right before
cond_earliest, but look for the last insn that x is modified in
within the same bb.
From-SVN: r247410
2017-04-29 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/80491
+ * ifcvt.c (noce_process_if_block): When looking for x setter
+ with missing else_bb, don't check only the insn right before
+ cond_earliest, but look for the last insn that x is modified in
+ within the same bb.
+
PR rtl-optimization/80491
* alias.c (memory_modified_in_insn_p): Return true for CALL_INSNs.
}
else
{
- insn_b = prev_nonnote_nondebug_insn (if_info->cond_earliest);
+ insn_b = if_info->cond_earliest;
+ do
+ insn_b = prev_nonnote_nondebug_insn (insn_b);
+ while (insn_b
+ && (BLOCK_FOR_INSN (insn_b)
+ == BLOCK_FOR_INSN (if_info->cond_earliest))
+ && !modified_in_p (x, insn_b));
+
/* We're going to be moving the evaluation of B down from above
COND_EARLIEST to JUMP. Make sure the relevant data is still
intact. */