diff mbox

[ARM] fix PR target/49385

Message ID BANLkTinZfJwRJErDo=2ELiMrvAkvJmOoNg@mail.gmail.com
State Accepted
Headers show

Commit Message

Ramana Radhakrishnan June 20, 2011, 12:16 p.m. UTC
Hi,

This fixes PR49385. We were allowing mem -> mem moves earlier. Thanks
to Revital for spotting this. Tested on qemu with arm-linux-gnueabi
cross and committed to trunk.

Cheers
Ramana

2011-06-20  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

        PR target/49385
        * config/arm/thumb2.md (*thumb2_movhi_insn): Make sure atleast
        one of the operands is a register.
diff mbox

Patch

Index: gcc/config/arm/thumb2.md
===================================================================
--- gcc/config/arm/thumb2.md	(revision 175205)
+++ gcc/config/arm/thumb2.md	(working copy)
@@ -207,7 +207,9 @@ 
 (define_insn "*thumb2_movhi_insn"
   [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,r")
 	(match_operand:HI 1 "general_operand"      "rI,n,r,m"))]
-  "TARGET_THUMB2"
+  "TARGET_THUMB2
+  && (register_operand (operands[0], HImode)
+     || register_operand (operands[1], HImode))"
   "@
    mov%?\\t%0, %1\\t%@ movhi
    movw%?\\t%0, %L1\\t%@ movhi