Commit 0c809f72 by Jakub Jelinek

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.
parent 710d54ed
2020-04-04 Jakub Jelinek <jakub@redhat.com>
PR c++/94477
* pt.c (tsubst_expr) <case OMP_MASTER>: Clear
omp_parallel_combined_clauses.
2020-04-03 Jason Merrill <jason@redhat.com>
PR c++/91966
......
......@@ -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);
......
2020-04-04 Jakub Jelinek <jakub@redhat.com>
PR c++/94477
* g++.dg/gomp/pr94477.C: New test.
2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
PR target/94467
......
// PR c++/94477
// { dg-do compile }
void foo ();
template <int>
void
bar ()
{
#pragma omp parallel master
foo ();
}
void
baz ()
{
bar<0> ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment