+2017-12-08 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/83304
+ * combine.c (move_deaths): If we do not know where a register died,
+ search for it.
+
2017-12-08 Richard Biener <rguenther@suse.de>
* gimple-loop-interchange.cc (tree_loop_interchange::interchange):
unsigned int regno = REGNO (x);
rtx_insn *where_dead = reg_stat[regno].last_death;
+ /* If we do not know where the register died, it may still die between
+ FROM_LUID and TO_INSN. If so, find it. This is PR83304. */
+ if (!where_dead)
+ {
+ rtx_insn *insn = prev_real_insn (to_insn);
+ while (insn
+ && BLOCK_FOR_INSN (insn) == BLOCK_FOR_INSN (to_insn)
+ && DF_INSN_LUID (insn) >= from_luid)
+ {
+ if (dead_or_set_regno_p (insn, regno))
+ {
+ if (find_regno_note (insn, REG_DEAD, regno))
+ where_dead = insn;
+ break;
+ }
+
+ insn = prev_real_insn (insn);
+ }
+ }
+
/* Don't move the register if it gets killed in between from and to. */
if (maybe_kill_insn && reg_set_p (x, maybe_kill_insn)
&& ! reg_referenced_p (x, maybe_kill_insn))