]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Disallow reduction with var private in containing parallel even on scope...
authorJakub Jelinek <jakub@redhat.com>
Wed, 29 Sep 2021 09:16:26 +0000 (11:16 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 29 Sep 2021 09:16:42 +0000 (11:16 +0200)
commita5709263af0a0b64b28b51762594c185a418d061
treeaf59c75e9a7b1076ac78f760d7a0fb4140ac81bd
parent45595edf42770737a8dbbfca3ace45e7b2a8fd71
openmp: Disallow reduction with var private in containing parallel even on scope [PR102504]

The standard has a restriction:
"A list item that appears in a reduction clause of a scope construct must be
shared in the parallel region to which a corresponding scope region binds."
similar to the restriction for worksharing constructs, but we were checking
it only on worksharing constructs and not for scope and ICEd later on during
omp expansion.

2021-09-29  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/102504
* gimplify.c (gimplify_scan_omp_clauses): Use omp_check_private even
in OMP_SCOPE clauses, not just on worksharing construct clauses.

* c-c++-common/gomp/scope-4.c: New test.

(cherry picked from commit d3e7bb15e28c554bf4484a912f3b9c18c60ec68f)
gcc/ChangeLog.omp
gcc/gimplify.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/gomp/scope-4.c [new file with mode: 0644]