]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/64734 (ICE at omp lowering)
authorJakub Jelinek <jakub@redhat.com>
Fri, 23 Jan 2015 18:30:51 +0000 (19:30 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 23 Jan 2015 18:30:51 +0000 (19:30 +0100)
PR middle-end/64734
* omp-low.c (scan_sharing_clauses): Don't ignore
OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION GOMP_MAP_POINTER clauses
on target data/update constructs.

* libgomp.c/pr64734.c: New test.

From-SVN: r220054

gcc/ChangeLog
gcc/omp-low.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c/pr64734.c [new file with mode: 0644]

index 80a5090166ac2ab1c42834704e5e09babf32de53..5ac33b2a4a3a372f15623dec31004a7ffe89510e 100644 (file)
@@ -1,3 +1,10 @@
+2015-01-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/64734
+       * omp-low.c (scan_sharing_clauses): Don't ignore
+       OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION GOMP_MAP_POINTER clauses
+       on target data/update constructs.
+
 2015-01-23  Wei Mi  <wmi@google.com>
 
        Backported from trunk.
index ea45e205bb9800dbd7db6d6c2141025676da9b81..6d9206c9530d4de146293750043db902aed7e76f 100644 (file)
@@ -1633,7 +1633,8 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
                 #pragma omp target data, there is nothing to map for
                 those.  */
              if (gimple_omp_target_kind (ctx->stmt) == GF_OMP_TARGET_KIND_DATA
-                 && !POINTER_TYPE_P (TREE_TYPE (decl)))
+                 && !POINTER_TYPE_P (TREE_TYPE (decl))
+                 && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c))
                break;
            }
          if (DECL_P (decl))
index 0c5042774e9b30e9fe8b88d868d53815b098eab4..81c62da380bcbf3b3f8263e0d280d92c1fd38cdc 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/64734
+       * libgomp.c/pr64734.c: New test.
+
 2014-12-03  Uros Bizjak  <ubizjak@gmail.com>
 
        * configure.tgt (x86_64-*-linux*): Tune -m32 multilib to generic.
diff --git a/libgomp/testsuite/libgomp.c/pr64734.c b/libgomp/testsuite/libgomp.c/pr64734.c
new file mode 100644 (file)
index 0000000..457f481
--- /dev/null
@@ -0,0 +1,55 @@
+/* PR middle-end/64734 */
+
+#include <stdlib.h>
+
+void
+foo (int *x, int *y)
+{
+  #pragma omp target map (alloc:x[0]) map (alloc:y[0:8])
+  {
+    int i;
+    for (i = 0; i < 8; i++)
+      if (y[i] != 2 + i)
+       break;
+    if (i != 8 || *x != 1)
+      *x = 6;
+    else
+      {
+       *x = 8;
+       for (i = 0; i < 8; i++)
+         y[i] = 9 + i;
+      }
+  }
+  #pragma omp target update from (y[0:8]) from (x[0])
+}
+
+void
+bar (void)
+{
+  int x = 1, y[32] = { 0 };
+  #pragma omp target data map (to:y[0:32]) map (to:x)
+    ;
+}
+
+int
+main ()
+{
+  int x = 1, y[8] = { 2, 3, 4, 5, 6, 7, 8, 9 }, i;
+  #pragma omp target data map (to:y[0:8]) map (to:x)
+    ;
+  #pragma omp target data map (to:y[0:8]) map (to:x)
+    {
+      #pragma omp target update from (y[0:8]) from (x)
+    }
+
+  #pragma omp target data map (to:y[0:8]) map (to:x)
+    foo (&x, &y[0]);
+
+  if (x != 8)
+    abort ();
+  for (i = 0; i < 8; i++)
+    if (y[i] != 9 + i)
+      abort ();
+
+  return 0;
+}