diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-05-27 23:31:40 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-05-27 23:31:40 +0200 |
commit | 36c7a3fff99326a1dd45f495ee8e1b6bfd6cf9f5 (patch) | |
tree | 38f0b99df61879faaca9017c663f679c6d32a82f /gcc | |
parent | fcfb80325f3ef08b0ee07edc42eef15298ba80ec (diff) | |
download | gcc-36c7a3fff99326a1dd45f495ee8e1b6bfd6cf9f5.zip gcc-36c7a3fff99326a1dd45f495ee8e1b6bfd6cf9f5.tar.gz gcc-36c7a3fff99326a1dd45f495ee8e1b6bfd6cf9f5.tar.bz2 |
omp-low.c (lower_omp_1): Look through ordered...
* omp-low.c (lower_omp_1) <case GIMPLE_ASSIGN>: Look through ordered,
critical, taskgroup and section regions when looking for a region
with non-NULL lastprivate_conditional_map.
* testsuite/libgomp.c-c++-common/lastprivate-conditional-3.c: New test.
From-SVN: r271672
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/omp-low.c | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6f75ae..ce00043 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-05-27 Jakub Jelinek <jakub@redhat.com> + + * omp-low.c (lower_omp_1) <case GIMPLE_ASSIGN>: Look through ordered, + critical, taskgroup and section regions when looking for a region + with non-NULL lastprivate_conditional_map. + 2019-05-27 Uroš Bizjak <ubizjak@gmail.com> * config/i386/i386.c (ix86_gen_add3): Remove indirect function. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index faab5d3..db9f504 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -10627,14 +10627,21 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx) goto regimplify; case GIMPLE_ASSIGN: - if (ctx && ctx->lastprivate_conditional_map) + for (omp_context *up = ctx; up; up = up->outer) { + if (gimple_code (up->stmt) == GIMPLE_OMP_ORDERED + || gimple_code (up->stmt) == GIMPLE_OMP_CRITICAL + || gimple_code (up->stmt) == GIMPLE_OMP_TASKGROUP + || gimple_code (up->stmt) == GIMPLE_OMP_SECTION) + continue; + else if (!up->lastprivate_conditional_map) + break; tree lhs = get_base_address (gimple_assign_lhs (stmt)); if (DECL_P (lhs)) - if (tree *v = ctx->lastprivate_conditional_map->get (lhs)) + if (tree *v = up->lastprivate_conditional_map->get (lhs)) { tree clauses - = gimple_omp_for_clauses (as_a <gomp_for *> (ctx->stmt)); + = gimple_omp_for_clauses (as_a <gomp_for *> (up->stmt)); tree c = omp_find_clause (clauses, OMP_CLAUSE__CONDTEMP_); c = omp_find_clause (OMP_CLAUSE_CHAIN (c), OMP_CLAUSE__CONDTEMP_); |