+2017-04-13 Jeff Law <law@redhat.com>
+
+ * config/mips.mips.md (zero_extendsidi2): Do not allow SP to appear
+ in operands[1] if it is a MEM and TARGET_MIPS16 is active.
+ (zero_extendsidi2_dext): Likewise.
+
2017-04-13 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/80403
(define_insn_and_split "*zero_extendsidi2"
[(set (match_operand:DI 0 "register_operand" "=d,d")
(zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,W")))]
- "TARGET_64BIT && !ISA_HAS_EXT_INS"
+ "TARGET_64BIT && !ISA_HAS_EXT_INS
+ && !(TARGET_MIPS16
+ && MEM_P (operands[1])
+ && reg_mentioned_p (stack_pointer_rtx, operands[1]))"
"@
#
lwu\t%0,%1"
(define_insn "*zero_extendsidi2_dext"
[(set (match_operand:DI 0 "register_operand" "=d,d")
(zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,W")))]
- "TARGET_64BIT && ISA_HAS_EXT_INS"
+ "TARGET_64BIT && ISA_HAS_EXT_INS
+ && !(TARGET_MIPS16
+ && MEM_P (operands[1])
+ && reg_mentioned_p (stack_pointer_rtx, operands[1]))"
"@
dext\t%0,%1,0,32
lwu\t%0,%1"