openmp: Notice reduction decl in outer contexts after adding it to shared [PR93515]
authorJakub Jelinek <jakub@redhat.com>
Thu, 6 Feb 2020 08:15:13 +0000 (09:15 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 6 Feb 2020 08:15:13 +0000 (09:15 +0100)
commitcf785618ecc90e3f063b99572de48cb91aa5ab5d
tree805eae2a3669c0e04bb46bf82b11d17a71503ba2
parent006eeaa819d2a58395ef448807025730939d165d
openmp: Notice reduction decl in outer contexts after adding it to shared [PR93515]

If we call omp_add_variable, following omp_notice_variable will already find it
on that construct and not go through outer constructs, the following patch fixes that.
Note, this still doesn't follow OpenMP 5.0 semantics on target combined with other
constructs with reduction/lastprivate/linear clauses, will handle that for GCC11.

2020-02-06  Jakub Jelinek  <jakub@redhat.com>

PR libgomp/93515
* gimplify.c (gimplify_scan_omp_clauses) <do_notice>: If adding
shared clause, call omp_notice_variable on outer context if any.
gcc/ChangeLog
gcc/gimplify.c