]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Initialise KEY and OFFSET fields when if_present test fails.
authorJulian Brown <julian@codesourcery.com>
Thu, 16 May 2019 12:46:34 +0000 (05:46 -0700)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 3 Mar 2020 11:17:39 +0000 (12:17 +0100)
libgomp/
* target.c (gomp_map_vars_async): Initialise KEY and OFFSET fields in
not-present case.

(cherry picked from openacc-gcc-9-branch commit
995f9680a46c3a7246fe465faa847f8009e47ed8)

libgomp/ChangeLog.omp
libgomp/target.c

index 675720b7593b94fe8e2b53e12c9df4f564c51f2a..ef5579bd38287f85954d961069153dfe8e0636a4 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-16  Julian Brown  <julian@codesourcery.com>
+
+       * target.c (gomp_map_vars_async): Initialise KEY and OFFSET fields in
+       not-present case.
+
 2019-01-09  Julian Brown  <julian@codesourcery.com>
 
        * libgomp.texi: Update mentions of OpenACC version to 2.6.  Update
index 8e6b4264b7208fb8dd7bae573fdc4153fb0225d5..a4ed763d507ccb66f1ce7ee5657cc20b45d7b860 100644 (file)
@@ -1103,8 +1103,12 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep,
          if (n == NULL)
            {
               if (pragma_kind == GOMP_MAP_VARS_OPENACC_IF_PRESENT)
-                /* No error, continue using the host address.  */
-                continue;
+               {
+                 /* No error, continue using the host address.  */
+                 tgt->list[i].key = NULL;
+                 tgt->list[i].offset = OFFSET_INLINED;
+                 continue;
+               }
              gomp_mutex_unlock (&devicep->lock);
              gomp_fatal ("use_device_ptr pointer wasn't mapped");
            }