diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-04-04 00:35:41 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-04-04 00:35:41 +0200 |
commit | 0c809f727cd2a6c70c307d9dd53d26dc84bf292a (patch) | |
tree | 2c6c49c579594101d168664f9d4a75c0d860a581 /gcc/cp/pt.c | |
parent | 710d54ed4e343a08d2fa0abc6b63c53dec0d9bcb (diff) | |
download | gcc-0c809f727cd2a6c70c307d9dd53d26dc84bf292a.zip gcc-0c809f727cd2a6c70c307d9dd53d26dc84bf292a.tar.gz gcc-0c809f727cd2a6c70c307d9dd53d26dc84bf292a.tar.bz2 |
openmp: Fix ICE on #pragma omp parallel master in template [PR94477]
The following testcase ICEs, because for parallel combined with some
other construct we initialize the omp_parallel_combined_clauses pointer
and expect the construct combined with it to clear it after it no longer
needs it, but OMP_MASTER didn't do that.
2020-04-04 Jakub Jelinek <jakub@redhat.com>
PR c++/94477
* pt.c (tsubst_expr) <case OMP_MASTER>: Clear
omp_parallel_combined_clauses.
* g++.dg/gomp/pr94477.C: New test.
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b602f9f..6122227 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18467,8 +18467,10 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, add_stmt (t); break; - case OMP_SECTION: case OMP_MASTER: + omp_parallel_combined_clauses = NULL; + /* FALLTHRU */ + case OMP_SECTION: stmt = push_stmt_list (); RECUR (OMP_BODY (t)); stmt = pop_stmt_list (stmt); |