From 83eb9522087c0f1f152873da00ade34e5f3e67e5 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 3 Jul 2019 06:56:25 +0200 Subject: 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 --- gcc/gimplify.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/gimplify.c') 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 -- cgit v1.1