From: Julian Brown Date: Thu, 16 May 2019 12:46:34 +0000 (-0700) Subject: Initialise KEY and OFFSET fields when if_present test fails. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dcd61cae159a31b2628f27b1e278aa49bfe8235;p=thirdparty%2Fgcc.git Initialise KEY and OFFSET fields when if_present test fails. 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) --- diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 675720b7593b..ef5579bd3828 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,8 @@ +2019-05-16 Julian Brown + + * target.c (gomp_map_vars_async): Initialise KEY and OFFSET fields in + not-present case. + 2019-01-09 Julian Brown * libgomp.texi: Update mentions of OpenACC version to 2.6. Update diff --git a/libgomp/target.c b/libgomp/target.c index 8e6b4264b720..a4ed763d507c 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -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"); }