]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/omp-low.c
Further changes for the OpenACC 'if_present' clause on the 'host_data' construct
[thirdparty/gcc.git] / gcc / omp-low.c
index 9a36192e8ef0489e2b5cf0e0479878bb38909532..eb3fe9688fe479c739fcea1d3778f772bd834d39 100644 (file)
@@ -12006,9 +12006,15 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
                tkind = GOMP_MAP_FIRSTPRIVATE_INT;
                x = build_sender_ref (ovar, ctx);
              }
-           if (tkind == GOMP_MAP_USE_DEVICE_PTR
-               && omp_find_clause (clauses, OMP_CLAUSE_IF_PRESENT))
-             tkind = GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT;
+
+           if (is_gimple_omp_oacc (ctx->stmt))
+             {
+               gcc_assert (tkind == GOMP_MAP_USE_DEVICE_PTR);
+
+               if (OMP_CLAUSE_USE_DEVICE_PTR_IF_PRESENT (c))
+                 tkind = GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT;
+             }
+
            type = TREE_TYPE (ovar);
            if (lang_hooks.decls.omp_array_data (ovar, true))
              var = lang_hooks.decls.omp_array_data (ovar, false);