aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-12-02 13:48:42 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-12-02 13:48:42 +0100
commitdaa8c1d763c951d2242e1842be80b179f63ebad2 (patch)
tree2e3655327f79bb903789d11133c2be9edf5b3baa /gcc/omp-low.c
parente80944753d325ef009acf58a5b3188936997d22b (diff)
downloadgcc-daa8c1d763c951d2242e1842be80b179f63ebad2.zip
gcc-daa8c1d763c951d2242e1842be80b179f63ebad2.tar.gz
gcc-daa8c1d763c951d2242e1842be80b179f63ebad2.tar.bz2
omp-low.c (check_omp_nesting_restrictions): Allow cancel or cancellation point with taskgroup clause inside of taskloop.
* omp-low.c (check_omp_nesting_restrictions): Allow cancel or cancellation point with taskgroup clause inside of taskloop. Consider a taskloop construct without nogroup clause as implicit taskgroup for diagnostics if cancel/cancellation point with taskgroup clause is closely nested inside of taskgroup region. * c-c++-common/gomp/cancel-1.c (f2): Add various taskloop related tests. * testsuite/libgomp.c-c++-common/cancel-taskgroup-4.c: New test. From-SVN: r266722
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index ca78d7a..b406ce7 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -2744,7 +2744,10 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
kind = "sections";
break;
case 8:
- if (gimple_code (ctx->stmt) != GIMPLE_OMP_TASK)
+ if (!is_task_ctx (ctx)
+ && (!is_taskloop_ctx (ctx)
+ || ctx->outer == NULL
+ || !is_task_ctx (ctx->outer)))
bad = "#pragma omp task";
else
{
@@ -2767,6 +2770,17 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
"nested inside of %<taskgroup%> region",
construct);
return false;
+ case GIMPLE_OMP_TASK:
+ if (gimple_omp_task_taskloop_p (octx->stmt)
+ && octx->outer
+ && is_taskloop_ctx (octx->outer))
+ {
+ tree clauses
+ = gimple_omp_for_clauses (octx->outer->stmt);
+ if (!omp_find_clause (clauses, OMP_CLAUSE_NOGROUP))
+ break;
+ }
+ continue;
default:
continue;
}