gnu/gcc/e67cac3f380da82cff5354d898ec11dfc2492306 OpenMP: Unshare expr in context-selector condition [PR121922]
As the testcase shows, a missing unshare_expr caused that the condition
was only evaluated once instead of every time when a 'declare variant'
was resolved.
PR middle-end/121922
gcc/ChangeLog:
* omp-general.cc (omp_dynamic_cond): Use 'unshare_expr' for
the user condition.
libgomp/ChangeLog:
* testsuite/libgomp.c-c++-common/declare-variant-1.c: New test.
Co-authored-by: Sandra Loosemore <sloosemore@baylibre.com>
(cherry picked from commit 97c1d2fa97afc59b02d2894b88069136145603e2)
2 files changed