+2017-02-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/79353
+ * config/sparc/sync.md (atomic_loaddi_1): Replace 'U' constraint with
+ 'r', 'm' constraint with 'T' and !TARGET_ARCH64 with TARGET_ARCH32.
+ (atomic_storedi_1): Likewise.
+
2017-02-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/79338
})
(define_insn "atomic_loaddi_1"
- [(set (match_operand:DI 0 "register_operand" "=U,?*f")
- (unspec:DI [(match_operand:DI 1 "memory_operand" "m,m")]
+ [(set (match_operand:DI 0 "register_operand" "=r,?*f")
+ (unspec:DI [(match_operand:DI 1 "memory_operand" "T,T")]
UNSPEC_ATOMIC))]
- "!TARGET_ARCH64"
+ "TARGET_ARCH32"
"ldd\t%1, %0"
[(set_attr "type" "load,fpload")])
})
(define_insn "atomic_storedi_1"
- [(set (match_operand:DI 0 "memory_operand" "=m,m,m")
+ [(set (match_operand:DI 0 "memory_operand" "=T,T,T")
(unspec:DI
- [(match_operand:DI 1 "register_or_v9_zero_operand" "J,U,?*f")]
+ [(match_operand:DI 1 "register_or_v9_zero_operand" "J,r,?*f")]
UNSPEC_ATOMIC))]
- "!TARGET_ARCH64"
+ "TARGET_ARCH32"
"@
stx\t%r1, %0
std\t%1, %0
+2017-02-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/sparc/20170205-1.c: New test.
+
2017-02-03 John David Anglin <danglin@gcc.gnu.org>
* gfortran.dg/coarray_43.f90: Add "-latomic" option if
--- /dev/null
+/* PR target/79363 */\r
+/* Reported by John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> */\r
+\r
+/* { dg-do compile } */\r
+/* { dg-options "-O2 -fPIC -mcpu=v8" } */\r
+\r
+struct d { long long h; };\r
+\r
+struct c { struct d *e; };\r
+\r
+int f, g;\r
+\r
+extern void bar (long long *);\r
+extern int baz (long long *, int);\r
+\r
+void foo (struct c *desc)\r
+{\r
+ int begin, end, j;\r
+ long long k, l, h;\r
+ for (;;) {\r
+ for (;;)\r
+ break;\r
+ for (;;) {\r
+ j++;\r
+ l = desc->e[j].h;\r
+ for (;;) {\r
+ bar(&l);\r
+ end = h = begin / 2;\r
+ if (baz(&h, g))\r
+ begin = f;\r
+ break;\r
+ }\r
+ if (end) {\r
+ __atomic_store_n(&k, end, 5);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+}\r