+2016-08-05 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/69847
+ * lra-constraints.c (process_invariant_for_inheritance): Save
+ pattern instead of src.
+ (remove_inheritance_pseudos): Use the pattern. Add assert.
+
2016-08-05 David Malcolm <dmalcolm@redhat.com>
* input.c (string_concat::string_concat): New constructor.
cl, "invariant inheritance");
bitmap_set_bit (&lra_inheritance_pseudos, REGNO (new_reg));
bitmap_set_bit (&check_only_regs, REGNO (new_reg));
- lra_reg_info[REGNO (new_reg)].restore_rtx = invariant_rtx;
+ lra_reg_info[REGNO (new_reg)].restore_rtx = PATTERN (insn);
start_sequence ();
lra_emit_move (new_reg, dst_reg);
new_insns = get_insns ();
start_sequence ();
/* We can not just change the source. It might be
an insn different from the move. */
- lra_emit_move (SET_DEST (set), lra_reg_info[sregno].restore_rtx);
+ emit_insn (lra_reg_info[sregno].restore_rtx);
rtx_insn *new_insns = get_insns ();
end_sequence ();
+ lra_assert (single_set (new_insns) != NULL
+ && SET_DEST (set) == SET_DEST (single_set (new_insns)));
lra_process_new_insns (curr_insn, NULL, new_insns,
"Changing reload<-invariant inheritance");
delete_move_and_clobber (curr_insn, dregno);