]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/79353 (ICE in curr_insn_transform, at lra-constraints.c:3773)
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 5 Feb 2017 09:47:48 +0000 (09:47 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 5 Feb 2017 09:47:48 +0000 (09:47 +0000)
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

gcc/ChangeLog
gcc/config/sparc/sync.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sparc/20170205-1.c [new file with mode: 0644]

index 3be3f74599414800a9c75472e73895134023b7e8..9e751381511d6e66a9b0c06b40f79341718b5092 100644 (file)
@@ -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
index 8db2d15b79bdd379637458dade10956a0ffc1c97..1593bdeb903f901331e01c200cf92610bee24e55 100644 (file)
 })
 
 (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
index f8cd36a033849332268847a6c14bff933366c03f..77aba28d51e4c2fa1a5bfd26c530cdddfe0b8fab 100644 (file)
@@ -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 (file)
index 0000000..b2e4d3f
--- /dev/null
@@ -0,0 +1,39 @@
+/* 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