]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[ARM] Fix sync.md ldrd output template for non-unified syntax
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Thu, 31 Mar 2016 16:33:51 +0000 (16:33 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Thu, 31 Mar 2016 16:33:51 +0000 (16:33 +0000)
* config/arm/sync.md (arm_atomic_loaddi2_ldrd): Fix output template
for non-unified syntax.

* gcc.target/arm/atomic_loaddi_relaxed_cond.c: New test.

From-SVN: r234642

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

index 2d2631c82dba6de4ed9f6e152e4f2f3facab999d..a0f3186a4f7c413d7c9428a2b9b8d11edd472543 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-31  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * config/arm/sync.md (arm_atomic_loaddi2_ldrd): Fix output template
+       for non-unified syntax.
+
 2016-03-31  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/70460
index 5218ea3b8cbfee1f2fb04dd8720a1810317976af..773b4b45fa480b0dedc2cb333025d6d90651c46c 100644 (file)
        [(match_operand:DI 1 "arm_sync_memory_operand" "Q")]
          VUNSPEC_LDRD_ATOMIC))]
   "ARM_DOUBLEWORD_ALIGN && TARGET_HAVE_LPAE"
-  "ldrd%?\t%0, %H0, %C1"
+  "ldr%(d%)\t%0, %H0, %C1"
   [(set_attr "predicable" "yes")
    (set_attr "predicable_short_it" "no")])
 
index c440eae34476e6fabd8a491bdec457e79827827b..52bdf72a3df5b018d3f77fbe1caf1342011d0f19 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-31  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * gcc.target/arm/atomic_loaddi_relaxed_cond.c: New test.
+
 2016-03-31  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/70460
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed_cond.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed_cond.c
new file mode 100644 (file)
index 0000000..d697751
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do assemble } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
+/* { dg-add-options arm_arch_v8a } */
+
+/* Check that if we conditionalise the atomic load we put the condition
+   code in the right place to create valid assembly.  */
+
+#include <stdatomic.h>
+
+atomic_ullong foo;
+int glob;
+
+int
+main (int argc, char *argv[])
+{
+  if (argc > 2)
+    atomic_load_explicit (&foo, memory_order_relaxed);
+  return glob;
+}