https://gcc.gnu.org/g:11263c048d39ab1d6a11067b18674bf8307bbbf5

commit 11263c048d39ab1d6a11067b18674bf8307bbbf5
Author: Paul-Antoine Arras <par...@baylibre.com>
Date:   Mon May 27 15:53:22 2024 +0200

    Handle non-contiguous target update in gimplify_scan_omp_clauses
    
    OG14 fixup for mainline commit 144c531fe25483b65ad3189d7b5e9f78154477c2
    "OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc"

Diff:
---
 gcc/gimplify.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 94d67a7935d..b91e098c280 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -12828,6 +12828,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq 
*pre_p,
       || code == OMP_TARGET_DATA
       || code == OMP_TARGET_ENTER_DATA
       || code == OMP_TARGET_EXIT_DATA
+      || code == OMP_TARGET_UPDATE
       || code == OACC_DATA
       || code == OACC_KERNELS
       || code == OACC_PARALLEL
@@ -15086,7 +15087,15 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, 
gimple_seq body, tree *list_p,
                                    : TYPE_SIZE_UNIT (TREE_TYPE (decl));
            }
          gimplify_omp_ctxp = ctx->outer_context;
-         if (gimplify_expr (&OMP_CLAUSE_SIZE (c), pre_p, NULL,
+         if (GOMP_MAP_NONCONTIG_ARRAY_P (OMP_CLAUSE_MAP_KIND (c)))
+           {
+             gcc_assert (OMP_CLAUSE_SIZE (c)
+                         && TREE_CODE (OMP_CLAUSE_SIZE (c)) == TREE_LIST);
+             /* For non-contiguous array maps, OMP_CLAUSE_SIZE is a TREE_LIST
+                of the individual array dimensions, which gimplify_expr doesn't
+                handle, so skip the call to gimplify_expr here.  */
+           }
+         else if (gimplify_expr (&OMP_CLAUSE_SIZE (c), pre_p, NULL,
                                  is_gimple_val, fb_rvalue) == GS_ERROR)
            {
              gimplify_omp_ctxp = ctx;

Reply via email to