Testcase from comex, see https://lwn.net/Articles/793932/ .
* config/rs6000/predicates.md (lwa_operand): Allow volatile memory.
gcc/testsuite/
* gcc.target/powerpc/volatile-mem.c: New testcase.
From-SVN: r273631
+2019-07-20 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/predicates.md (lwa_operand): Allow volatile memory.
+
2019-07-20 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/predicates.md (volatile_mem_operand): Modernize syntax.
if (gpc_reg_operand (inner, mode))
return true;
- if (!memory_operand (inner, mode))
+ if (!any_memory_operand (inner, mode))
return false;
addr = XEXP (inner, 0);
+2019-07-20 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/volatile-mem.c: New testcase.
+
2019-07-20 Jakub Jelinek <jakub@redhat.com>
PR target/91204
--- /dev/null
+/* { dg-options "-O2 -std=c11" } */
+/* { dg-require-effective-target lp64 } */
+
+/* This tests if the instructions used for C atomic are optimised properly
+ as atomic by the target code, too. */
+
+#include <stdatomic.h>
+
+int load(_Atomic int *ptr)
+{
+ return atomic_load_explicit(ptr, memory_order_relaxed);
+}
+
+/* There should be only two machine instructions, an lwa and a blr: */
+/* { dg-final { scan-assembler-times {(?n)^\s+[a-z]} 2 } } */
+/* { dg-final { scan-assembler-times {\mlwa\M} 1 } } */