re PR middle-end/67517 (ICE in gimplify_scan_omp_clauses)
authorJakub Jelinek <jakub@redhat.com>
Thu, 10 Sep 2015 07:32:13 +0000 (09:32 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 10 Sep 2015 07:32:13 +0000 (09:32 +0200)
PR middle-end/67517
* gimplify.c (gimplify_scan_omp_clauses): Instead of
asserting that decl is not specified in octx->variables,
break out of the loop if it is.

* c-c++-common/gomp/pr67517.c: New test.

From-SVN: r227608

gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/gomp/pr67517.c [new file with mode: 0644]

index 4a2a1f3f00aac55d1b298212a080394f7bd9b2ad..89ec6f399fb5c69eb844239524c2acb1763196ca 100644 (file)
@@ -1,5 +1,10 @@
 2015-09-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/67517
+       * gimplify.c (gimplify_scan_omp_clauses): Instead of
+       asserting that decl is not specified in octx->variables,
+       break out of the loop if it is.
+
        PR c++/67514
        * gimplify.c (gimplify_omp_for): For loop SIMD construct, if
        iterator is not explicitly determined, but is defined inside
index 215ad1584870010cafecbfc1866273ab2c646dd9..2a7da25a9060cc7d0b8590c71076602186bcc249 100644 (file)
@@ -6214,9 +6214,12 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
                    }
                  else
                    break;
-                 gcc_checking_assert (splay_tree_lookup (octx->variables,
-                                                         (splay_tree_key)
-                                                         decl) == NULL);
+                 if (splay_tree_lookup (octx->variables,
+                                        (splay_tree_key) decl) != NULL)
+                   {
+                     octx = NULL;
+                     break;
+                   }
                  flags = GOVD_SEEN;
                  if (!OMP_CLAUSE_LINEAR_NO_COPYIN (c))
                    flags |= GOVD_FIRSTPRIVATE;
index 2d26e5579dec66d50f6092726d25b78a8a87efe1..7f00368b2e5c594875466381514b173589a8b995 100644 (file)
@@ -1,5 +1,8 @@
 2015-09-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/67517
+       * c-c++-common/gomp/pr67517.c: New test.
+
        PR c++/67514
        * g++.dg/gomp/pr67514.C: New test.
 
diff --git a/gcc/testsuite/c-c++-common/gomp/pr67517.c b/gcc/testsuite/c-c++-common/gomp/pr67517.c
new file mode 100644 (file)
index 0000000..3055ffb
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR middle-end/67517 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int
+foo (int x, int y, int z)
+{
+  int i;
+  #pragma omp parallel for simd linear (y : x & 15) linear (x : 16) linear (z : x & 15)
+  for (i = 0; i < 256; ++i)
+    x += 16, y += x & 15, z += x & 15;
+  return x + y + z;
+}