For cases like: #pragma omp target update from(s[0].a[0:1])
The handling in [c_]finish_omp_clauses was only peeling off ARRAY_REF once before the loop handling COMPONENT_REF, and snagged when the base of the component_ref is an array access. This adds the handling there for both C and C++ front-ends. (ICE started to happen after https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=6c0399378e77d029 where map/from/to clause syntax was relaxed to allow more stuff) Tested without regressions, okay to commit? Thanks, Chung-Lin 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.