OSDN Git Service

PR target/52375
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Feb 2012 15:53:15 +0000 (15:53 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Feb 2012 15:53:15 +0000 (15:53 +0000)
* config/arm/neon.md (vashr<mode>3, vlshr<mode>3): Use
s_register_operand in the test instead of REG_P.  Don't call
gen_reg_rtx if it won't be used.

* gcc.target/arm/pr52375.c: New test.
* gcc.c-torture/compile/pr52375.c: New test.

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

gcc/ChangeLog
gcc/config/arm/neon.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr52375.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/pr52375.c [new file with mode: 0644]

index 1a9e0f9..0406ed2 100644 (file)
@@ -1,5 +1,10 @@
 2012-02-27  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/52375
+       * config/arm/neon.md (vashr<mode>3, vlshr<mode>3): Use
+       s_register_operand in the test instead of REG_P.  Don't call
+       gen_reg_rtx if it won't be used.
+
        PR tree-optimization/52376
        * ipa-split.c (split_function): Ignore CLOBBER stmts.
 
index a6c891d..e0d6a0c 100644 (file)
                        (match_operand:VDQIW 2 "imm_rshift_or_reg_neon" "")))]
   "TARGET_NEON"
 {
-  rtx neg = gen_reg_rtx (<MODE>mode);
-  if (REG_P (operands[2]))
+  if (s_register_operand (operands[2], <MODE>mode))
     {
+      rtx neg = gen_reg_rtx (<MODE>mode);
       emit_insn (gen_neg<mode>2 (neg, operands[2]));
       emit_insn (gen_ashl<mode>3_signed (operands[0], operands[1], neg));
     }
                        (match_operand:VDQIW 2 "imm_rshift_or_reg_neon" "")))]
   "TARGET_NEON"
 {
-  rtx neg = gen_reg_rtx (<MODE>mode);
-  if (REG_P (operands[2]))
+  if (s_register_operand (operands[2], <MODE>mode))
     {
+      rtx neg = gen_reg_rtx (<MODE>mode);
       emit_insn (gen_neg<mode>2 (neg, operands[2]));
       emit_insn (gen_ashl<mode>3_unsigned (operands[0], operands[1], neg));
     }
index 0af8d11..5c9f70c 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/52375
+       * gcc.target/arm/pr52375.c: New test.
+       * gcc.c-torture/compile/pr52375.c: New test.
+
 2012-02-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * gfortran.dg/typebound_operator_9.f03: Skip on SPU.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr52375.c b/gcc/testsuite/gcc.c-torture/compile/pr52375.c
new file mode 100644 (file)
index 0000000..e6877bb
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR target/52375 */
+
+struct C { int c, d; };
+
+unsigned
+foo (struct C *p)
+{
+  unsigned int b = 0, i;
+  for (i = 0; i < 64; i++)
+    b |= 0x80000000U >> p[i].c;
+  return b;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr52375.c b/gcc/testsuite/gcc.target/arm/pr52375.c
new file mode 100644 (file)
index 0000000..0405c66
--- /dev/null
@@ -0,0 +1,15 @@
+/* PR target/52375 */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-march=armv7-a -mfloat-abi=hard -mfpu=neon -O -ftree-vectorize" } */
+
+struct C { int c, d; };
+
+unsigned
+foo (struct C *p)
+{
+  unsigned int b = 0, i;
+  for (i = 0; i < 64; i++)
+    b |= 0x80000000U >> p[i].c;
+  return b;
+}