diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-12-15 10:27:08 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-12-15 10:27:08 +0100 |
commit | c0e34451ae582c901a2df08498b36f68ae401f0a (patch) | |
tree | ced35408396bc82f42e028c2d4527b47eb6f4b08 /gcc/cp/semantics.c | |
parent | a5b4ebc217afe6c31334e017d1fead4a6b8e53b2 (diff) | |
download | gcc-c0e34451ae582c901a2df08498b36f68ae401f0a.zip gcc-c0e34451ae582c901a2df08498b36f68ae401f0a.tar.gz gcc-c0e34451ae582c901a2df08498b36f68ae401f0a.tar.bz2 |
openmp: Avoid calling operand_equal_p on OMP_CLAUSEs [PR103704]
On OMP_CLAUSEs we reuse TREE_TYPE as CP_OMP_CLAUSE_INFO in the C++ FE.
This confuses the hashing code that operand_equal_p does when checking.
There is really no reason to compare OMP_CLAUSEs against expressions
like captured this, they will never compare equal.
2021-12-15 Jakub Jelinek <jakub@redhat.com>
PR c++/103704
* semantics.c (finish_omp_target_clauses_r): For OMP_CLAUSEs
just walk subtrees.
* g++.dg/gomp/pr103704.C: New test.
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index d8b20ff..356fb83 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -9325,6 +9325,9 @@ finish_omp_target_clauses_r (tree *tp, int *walk_subtrees, void *ptr) return NULL_TREE; } + if (TREE_CODE (t) == OMP_CLAUSE) + return NULL_TREE; + if (current_object) { tree this_expr = TREE_OPERAND (current_object, 0); |