[09/16] OpenMP: Allow array ref components for C & C++
Commit Message
This patch fixes parsing for struct components that are array references
in OMP clauses in both the C and C++ front ends.
OK?
Thanks,
Julian
2021-09-29 Julian Brown <julian@codesourcery.com>
gcc/c/
* c-typeck.c (c_finish_omp_clauses): Allow ARRAY_REF components.
gcc/cp/
* semantics.c (finish_omp_clauses): Allow ARRAY_REF components.
---
gcc/c/c-typeck.c | 3 ++-
gcc/cp/semantics.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
@@ -14918,7 +14918,8 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
{
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == MEM_REF
- || TREE_CODE (t) == INDIRECT_REF)
+ || TREE_CODE (t) == INDIRECT_REF
+ || TREE_CODE (t) == ARRAY_REF)
{
t = TREE_OPERAND (t, 0);
STRIP_NOPS (t);
@@ -7910,7 +7910,8 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
if (REFERENCE_REF_P (t))
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == MEM_REF
- || TREE_CODE (t) == INDIRECT_REF)
+ || TREE_CODE (t) == INDIRECT_REF
+ || TREE_CODE (t) == ARRAY_REF)
{
t = TREE_OPERAND (t, 0);
STRIP_NOPS (t);