aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-09-10 09:32:13 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-09-10 09:32:13 +0200
commit2ee10f818d0ae2d421ff6df19923acf509d71721 (patch)
treef887371c4dd5c08474c7e1690e8bbafffbc6e299
parent499c20bbe466b6c71bda3b2e3eee044e9364911c (diff)
downloadgcc-2ee10f818d0ae2d421ff6df19923acf509d71721.zip
gcc-2ee10f818d0ae2d421ff6df19923acf509d71721.tar.gz
gcc-2ee10f818d0ae2d421ff6df19923acf509d71721.tar.bz2
re PR middle-end/67517 (ICE in gimplify_scan_omp_clauses)
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gimplify.c9
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr67517.c13
4 files changed, 27 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4a2a1f3..89ec6f3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 215ad15..2a7da25 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2d26e55..7f00368 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..3055ffb
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr67517.c
@@ -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;
+}