]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/45094 ([arm] wrong instructions for dword move in some cases)
authorYao Qi <yao@codesourcery.com>
Wed, 18 Aug 2010 12:33:43 +0000 (12:33 +0000)
committerYao Qi <qiyao@gcc.gnu.org>
Wed, 18 Aug 2010 12:33:43 +0000 (12:33 +0000)
gcc/
        PR target/45094
        * config/arm/arm.c (output_move_double): Fix typo generating
        instructions ('ldr'->'str').

gcc/testsuite/

        PR target/45094
        * gcc.target/arm/pr45094.c: New test.

From-SVN: r163338

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr45094.c [new file with mode: 0644]

index c16adad4bd75e22cb0872bc9478045a199f7ad91..124b3cb38c380f2b955ffa16f02bdb6f0c05aae0 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-18  Yao Qi  <yao@codesourcery.com>
+
+       PR target/45094
+       * config/arm/arm.c (output_move_double): Fix typo generating 
+       instructions ('ldr'->'str').
+
 2010-08-18  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        PR rtl-optimization/42575
index 3dd73e8c0d969a68e8976c4bb6158bdd832f6143..f6148a7309d59eb4f0cfa3c0e03aa514ddc63de7 100644 (file)
@@ -12944,13 +12944,13 @@ output_move_double (rtx *operands)
            {
              if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY)
                {
-                 output_asm_insn ("ldr%?\t%0, [%1, %2]!", otherops);
-                 output_asm_insn ("ldr%?\t%H0, [%1, #4]", otherops);
+                 output_asm_insn ("str%?\t%0, [%1, %2]!", otherops);
+                 output_asm_insn ("str%?\t%H0, [%1, #4]", otherops);
                }
              else
                {
-                 output_asm_insn ("ldr%?\t%H0, [%1, #4]", otherops);
-                 output_asm_insn ("ldr%?\t%0, [%1], %2", otherops);
+                 output_asm_insn ("str%?\t%H0, [%1, #4]", otherops);
+                 output_asm_insn ("str%?\t%0, [%1], %2", otherops);
                }
            }
          else if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY)
index 793018363ab812d8c78417bbdbce871a80ca41bd..2e2912e79e89f72505bac7fa516869c43c6ea46f 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-18  Yao Qi  <yao@codesourcery.com>
+
+       PR target/45094
+       * gcc.target/arm/pr45094.c: New test.
+
 2010-08-18  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        * gcc.target/arm/mla-1.c: Use thumb-friendly architecture.
diff --git a/gcc/testsuite/gcc.target/arm/pr45094.c b/gcc/testsuite/gcc.target/arm/pr45094.c
new file mode 100644 (file)
index 0000000..05f16d8
--- /dev/null
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O2 -mcpu=cortex-a8" } */
+/* { dg-add-options arm_neon } */
+
+#include <stdlib.h>
+
+long long buffer[32];
+
+void __attribute__((noinline)) f(long long *p, int n)
+{
+  while (--n >= 0)
+    {
+      *p = 1;
+      p += 32;
+    }
+}
+
+int main(void)
+{
+  f(buffer, 1);
+  
+  if (!buffer[0])
+    abort();
+
+  return 0;
+}