aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-07-03 06:56:25 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-07-03 06:56:25 +0200
commit83eb9522087c0f1f152873da00ade34e5f3e67e5 (patch)
treedf2542661fab9ef8615c69f2f2a5c03502eec739 /gcc/gimplify.c
parent1a39b3d3e22ba34b750e277fae9634d0af015cae (diff)
downloadgcc-83eb9522087c0f1f152873da00ade34e5f3e67e5.zip
gcc-83eb9522087c0f1f152873da00ade34e5f3e67e5.tar.gz
gcc-83eb9522087c0f1f152873da00ade34e5f3e67e5.tar.bz2
gimplify.c (gimplify_scan_omp_clauses): For inscan reductions on worksharing loop propagate it as shared clause to...
* gimplify.c (gimplify_scan_omp_clauses): For inscan reductions on worksharing loop propagate it as shared clause to containing combined parallel. * c-omp.c (c_omp_split_clauses): Put OMP_CLAUSE_REDUCTION_INSCAN clauses on OMP_FOR rather than OMP_PARALLEL when OMP_FOR is combined with OMP_PARALLEL. * c-c++-common/gomp/scan-5.c: New test. From-SVN: r272957
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5c51f50..9e5e423 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -9125,7 +9125,10 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
" or private in outer context", DECL_NAME (decl));
}
do_notice:
- if ((region_type & ORT_TASKLOOP) == ORT_TASKLOOP
+ if (((region_type & ORT_TASKLOOP) == ORT_TASKLOOP
+ || (region_type == ORT_WORKSHARE
+ && OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
+ && OMP_CLAUSE_REDUCTION_INSCAN (c)))
&& outer_ctx
&& outer_ctx->region_type == ORT_COMBINED_PARALLEL
&& (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION