openmp: Fix ICE in [PR103705]
authorChung-Lin Tang <cltang@codesourcery.com>
Fri, 14 Jan 2022 13:58:34 +0000 (21:58 +0800)
committerChung-Lin Tang <cltang@codesourcery.com>
Fri, 14 Jan 2022 13:58:34 +0000 (21:58 +0800)
commitcd7484d05cd4b7a9d741fe8bf6c4525406ed7620
tree8d96741268638619e714f5d62017838f0a77fc9d
parent5d7de2bf3b7c5ed1c929098243832b59648bcc67
openmp: Fix ICE in [PR103705]

Fix ICE for cases like:
  #pragma omp target update from(s[0].a[0:1])

where multiple ARRAY_REF nodes exist and require more than one peeling
during [c_]finish_omp_clauses.

PR c++/103705

gcc/c/ChangeLog:

* c-typeck.c (c_finish_omp_clauses): Also continue peeling off of
outer node for ARRAY_REFs.

gcc/cp/ChangeLog:

* semantics.c (finish_omp_clauses): Also continue peeling off of
outer node for ARRAY_REFs.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/pr103705.c: New test.
gcc/c/c-typeck.c
gcc/cp/semantics.c
gcc/testsuite/c-c++-common/gomp/pr103705.c [new file with mode: 0644]