openmp: Fix parallel master error recovery [PR94512]
authorJakub Jelinek <jakub@redhat.com>
Tue, 7 Apr 2020 12:30:53 +0000 (14:30 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 7 Apr 2020 12:30:53 +0000 (14:30 +0200)
commit4df50a059fbd4d4a1cb067bd43caccdfca0327a8
tree5b56ab4714e7f68a8262ee6a2f5a33b26e9f3282
parent7a6588fe65432c0f1a8b5fdefba81700ebf88711
openmp: Fix parallel master error recovery [PR94512]

We need to set OMP_PARALLEL_COMBINED only if the parsing of omp_master
succeeded, because otherwise there is no nested master construct in the
parallel.

2020-04-07  Jakub Jelinek  <jakub@redhat.com>

PR c++/94512
* c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
if c_parser_omp_master succeeded.

* parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
if cp_parser_omp_master succeeded.

* g++.dg/gomp/pr94512.C: New test.
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr94512.C [new file with mode: 0644]