diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-12-08 10:45:30 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-12-08 10:45:30 +0100 |
commit | 31007091b10944c358e5038a6271d7e2744cde37 (patch) | |
tree | beb5b083c035dd644ad764ab68d9ab8f6c240a4c /gcc/c-family/c-pragma.c | |
parent | c2c198bfd1e747b761c6b9b13417685bd4378d57 (diff) | |
download | gcc-31007091b10944c358e5038a6271d7e2744cde37.zip gcc-31007091b10944c358e5038a6271d7e2744cde37.tar.gz gcc-31007091b10944c358e5038a6271d7e2744cde37.tar.bz2 |
openmp: -fopenmp-simd fixes [PR98187]
This patch fixes two bugs in the -fopenmp-simd support. One is that
in C++ #pragma omp parallel master would actually create OMP_PARALLEL
in the IL, which is a big no-no for -fopenmp-simd, we should be creating
only the constructs -fopenmp-simd handles (mainly OMP_SIMD, OMP_LOOP which
is gimplified as simd in that case, declare simd/reduction and ordered simd).
The other bug was that #pragma omp master taskloop simd combined construct
contains simd and thus should be recognized as #pragma omp simd (with only
the simd applicable clauses), but as master wasn't included in
omp_pragmas_simd, we'd ignore it completely instead.
2020-12-08 Jakub Jelinek <jakub@redhat.com>
PR c++/98187
* c-pragma.c (omp_pragmas): Remove "master".
(omp_pragmas_simd): Add "master".
* parser.c (cp_parser_omp_parallel): For parallel master with
-fopenmp-simd only, just call cp_parser_omp_master instead of
wrapping it in OMP_PARALLEL.
* c-c++-common/gomp/pr98187.c: New test.
Diffstat (limited to 'gcc/c-family/c-pragma.c')
-rw-r--r-- | gcc/c-family/c-pragma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c index d68985c..14d77e0 100644 --- a/gcc/c-family/c-pragma.c +++ b/gcc/c-family/c-pragma.c @@ -1317,7 +1317,6 @@ static const struct omp_pragma_def omp_pragmas[] = { { "depobj", PRAGMA_OMP_DEPOBJ }, { "end", PRAGMA_OMP_END_DECLARE_TARGET }, { "flush", PRAGMA_OMP_FLUSH }, - { "master", PRAGMA_OMP_MASTER }, { "requires", PRAGMA_OMP_REQUIRES }, { "section", PRAGMA_OMP_SECTION }, { "sections", PRAGMA_OMP_SECTIONS }, @@ -1333,6 +1332,7 @@ static const struct omp_pragma_def omp_pragmas_simd[] = { { "distribute", PRAGMA_OMP_DISTRIBUTE }, { "for", PRAGMA_OMP_FOR }, { "loop", PRAGMA_OMP_LOOP }, + { "master", PRAGMA_OMP_MASTER }, { "ordered", PRAGMA_OMP_ORDERED }, { "parallel", PRAGMA_OMP_PARALLEL }, { "scan", PRAGMA_OMP_SCAN }, |