diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-07-31 09:49:56 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-07-31 09:49:56 +0200 |
commit | c3ac76aa4078e84d8ca0daf6dab7bc9738f3aa33 (patch) | |
tree | c13a0daa48a9a1a3af2429643d918d7c43b54641 /gcc | |
parent | a25f3e8efbbc7182fa58c445574848a73856e9b4 (diff) | |
download | gcc-c3ac76aa4078e84d8ca0daf6dab7bc9738f3aa33.zip gcc-c3ac76aa4078e84d8ca0daf6dab7bc9738f3aa33.tar.gz gcc-c3ac76aa4078e84d8ca0daf6dab7bc9738f3aa33.tar.bz2 |
re PR middle-end/91301 (ICE in omp_add_variable on random access iterator distribute parallel for private (iterator))
PR middle-end/91301
* gimplify.c (gimplify_omp_for): If for class iterator on
distribute parallel for there is no data sharing clause
on inner_for_stmt, look for private clause on combined
parallel too and if found, move it to inner_for_stmt.
* testsuite/libgomp.c++/for-27.C: New test.
From-SVN: r273922
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/gimplify.c | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c946bba..2932538 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-07-31 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/91301 + * gimplify.c (gimplify_omp_for): If for class iterator on + distribute parallel for there is no data sharing clause + on inner_for_stmt, look for private clause on combined + parallel too and if found, move it to inner_for_stmt. + 2019-07-31 Richard Sandiford <richard.sandiford@arm.com> * lra-int.h (lra_operand_data): Remove early_clobber field. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index a40c7ce..6a1a7f0 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -10663,6 +10663,22 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p) && OMP_CLAUSE_DECL (*pc) == orig_decl) break; if (*pc == NULL_TREE) + { + tree *spc; + for (spc = &OMP_PARALLEL_CLAUSES (*data[1]); + *spc; spc = &OMP_CLAUSE_CHAIN (*spc)) + if (OMP_CLAUSE_CODE (*spc) == OMP_CLAUSE_PRIVATE + && OMP_CLAUSE_DECL (*spc) == orig_decl) + break; + if (*spc) + { + tree c = *spc; + *spc = OMP_CLAUSE_CHAIN (c); + OMP_CLAUSE_CHAIN (c) = NULL_TREE; + *pc = c; + } + } + if (*pc == NULL_TREE) ; else if (OMP_CLAUSE_CODE (*pc) == OMP_CLAUSE_PRIVATE) { |