gcc/ 2014-07-11 Marat Zakirov <m.zakirov@samsung.com>
authormzakirov <mzakirov@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jul 2014 09:02:39 +0000 (09:02 +0000)
committerDongkyun, Son <dongkyun.s@samsung.com>
Sun, 22 May 2016 10:47:30 +0000 (19:47 +0900)
PR target/61561
* config/arm/arm.md (*movhi_insn_arch4): Handle stack pointer.
(*movhi_bytes): Likewise.
(*arm_movqi_insn): Likewise.

gcc/testsuite/
2014-07-11  Marat Zakirov  <m.zakirov@samsung.com>

PR target/61561
* gcc.dg/pr61561.c: New test.

Change-Id: I977cff643e5fa4b119a3c662510bdf7664d8a2e6
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212450 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/arm/arm.md
gcc/testsuite/gcc.dg/pr61561.c [new file with mode: 0644]

index fd5024d..ea603ab 100644 (file)
 ;; Pattern to recognize insn generated default case above
 (define_insn "*movhi_insn_arch4"
   [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m,r")
-       (match_operand:HI 1 "general_operand"      "rI,K,n,r,mi"))]
+       (match_operand:HI 1 "general_operand"      "rIk,K,n,r,mi"))]
   "TARGET_ARM
    && arm_arch4
    && (register_operand (operands[0], HImode)
 
 (define_insn "*movhi_bytes"
   [(set (match_operand:HI 0 "s_register_operand" "=r,r,r")
-       (match_operand:HI 1 "arm_rhs_operand"  "I,r,K"))]
+       (match_operand:HI 1 "arm_rhs_operand"  "I,rk,K"))]
   "TARGET_ARM"
   "@
    mov%?\\t%0, %1\\t%@ movhi
 
 (define_insn "*arm_movqi_insn"
   [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,r,l,r,l,Uu,r,m")
-       (match_operand:QI 1 "general_operand" "r,r,I,Py,K,Uu,l,m,r"))]
+       (match_operand:QI 1 "general_operand" "rk,rk,I,Py,K,Uu,l,m,r"))]
   "TARGET_32BIT
    && (   register_operand (operands[0], QImode)
        || register_operand (operands[1], QImode))"
diff --git a/gcc/testsuite/gcc.dg/pr61561.c b/gcc/testsuite/gcc.dg/pr61561.c
new file mode 100644 (file)
index 0000000..1512f20
--- /dev/null
@@ -0,0 +1,15 @@
+/* PR c/61561.  */
+/* { dg-do assemble } */
+/* { dg-options " -w -O2" } */
+
+int dummy (int a);
+
+char a;
+short b;
+
+void mmm (void)
+{
+  char dyn[dummy (3)];
+  a = (char)&dyn[0];
+  b = (short)&dyn[0];
+}