* compare-elim.c (equivalent_reg_at_start): Return NULL_RTX
when returned register mode doesn't match original mode.
From-SVN: r248009
+2017-05-13 Uros Bizjak <ubizjak@gmail.com>
+
+ * compare-elim.c (equivalent_reg_at_start): Return NULL_RTX
+ when returned register mode doesn't match original mode.
+
2017-05-12 Jeff Law <law@redhat.com>
Jakub Jelinek <jakub@redhat.com>
- * config/mn10300/mn10300.c (mn10300_match_ccmode): Fix where
+ * config/mn10300/mn10300.c (mn10300_match_ccmode): Fix where
we look for cc setter after the compare-elim changes.
* config/mn10300/mn10300.md (addsi3_flags): Fix order of patterns
within the vector to match what compare-elim now expects.
static rtx
equivalent_reg_at_start (rtx reg, rtx_insn *end, rtx_insn *start)
{
+ machine_mode orig_mode = GET_MODE (reg);
rtx_insn *bb_head = BB_HEAD (BLOCK_FOR_INSN (end));
for (rtx_insn *insn = PREV_INSN (end);
return NULL_RTX;
}
+ if (GET_MODE (reg) != orig_mode)
+ return NULL_RTX;
+
return reg;
}