aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-02-05 09:47:48 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-02-05 09:47:48 +0000
commitf3877b2f7077963f9c688a4116e6d8abd0d212a6 (patch)
tree551cbc1ba48f1fca108cba8affe6cd811a8e26b4 /gcc
parent46628ab7ac4b2d80ce12a9a697f88733984594ec (diff)
downloadgcc-f3877b2f7077963f9c688a4116e6d8abd0d212a6.zip
gcc-f3877b2f7077963f9c688a4116e6d8abd0d212a6.tar.gz
gcc-f3877b2f7077963f9c688a4116e6d8abd0d212a6.tar.bz2
re PR target/79353 (ICE in curr_insn_transform, at lra-constraints.c:3773)
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. From-SVN: r245188
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/sparc/sync.md12
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/sparc/20170205-1.c39
4 files changed, 56 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3be3f74..9e75138 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/gcc/config/sparc/sync.md b/gcc/config/sparc/sync.md
index 8db2d15..1593bde 100644
--- a/gcc/config/sparc/sync.md
+++ b/gcc/config/sparc/sync.md
@@ -133,10 +133,10 @@
})
(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")])
@@ -160,11 +160,11 @@
})
(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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f8cd36a..77aba28 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+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
diff --git a/gcc/testsuite/gcc.target/sparc/20170205-1.c b/gcc/testsuite/gcc.target/sparc/20170205-1.c
new file mode 100644
index 0000000..b2e4d3f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/20170205-1.c
@@ -0,0 +1,39 @@
+/* PR target/79363 */
+/* Reported by John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fPIC -mcpu=v8" } */
+
+struct d { long long h; };
+
+struct c { struct d *e; };
+
+int f, g;
+
+extern void bar (long long *);
+extern int baz (long long *, int);
+
+void foo (struct c *desc)
+{
+ int begin, end, j;
+ long long k, l, h;
+ for (;;) {
+ for (;;)
+ break;
+ for (;;) {
+ j++;
+ l = desc->e[j].h;
+ for (;;) {
+ bar(&l);
+ end = h = begin / 2;
+ if (baz(&h, g))
+ begin = f;
+ break;
+ }
+ if (end) {
+ __atomic_store_n(&k, end, 5);
+ break;
+ }
+ }
+ }
+}