openmp: Fix up handling of implicit lastprivate on outer constructs for implicit...
authorJakub Jelinek <jakub@redhat.com>
Fri, 21 May 2021 19:13:06 +0000 (21:13 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 21 May 2021 19:13:06 +0000 (21:13 +0200)
commit0c6e792dd5c96a48c873b73c2d5b1ee4fc4b6b8e
treeee7e53ab9316d9b7fd3bab117116b0f875442d44
parent325aa13996bafce0c4927876c315d1fa706d9881
openmp: Fix up handling of implicit lastprivate on outer constructs for implicit linear and lastprivate IVs [PR99928]

This patch fixes the handling of lastprivate propagation to outer combined/composite
leaf constructs from implicit linear or lastprivate clauses on simd IVs and adds missing
testsuite coverage for explicit and implicit lastprivate on simd IVs.

2021-05-21  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/99928
* gimplify.c (omp_lastprivate_for_combined_outer_constructs): New
function.
(gimplify_scan_omp_clauses) <case OMP_CLAUSE_LASTPRIVATE>: Use it.
(gimplify_omp_for): Likewise.

* c-c++-common/gomp/pr99928-6.c: Remove all xfails.
* c-c++-common/gomp/pr99928-13.c: New test.
* c-c++-common/gomp/pr99928-14.c: New test.
gcc/gimplify.c
gcc/testsuite/c-c++-common/gomp/pr99928-13.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/pr99928-14.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/pr99928-6.c