public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/vect_cond_expr-rework-v3)] libgomp – fix declare target link handling (PR94251)
@ 2020-03-25 15:11 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2020-03-25 15:11 UTC (permalink / raw)
  To: gcc-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2015 bytes --]

https://gcc.gnu.org/g:4897bb0045dd68474176be9aafb4d77bac4b363a

commit 4897bb0045dd68474176be9aafb4d77bac4b363a
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Mar 23 15:29:05 2020 +0100

    libgomp – fix declare target link handling (PR94251)
    
            PR libgomp/94251
            * target.c (gomp_load_image_to_device): Fix link
            variable handling.

Diff:
---
 libgomp/ChangeLog | 6 ++++++
 libgomp/target.c  | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index f7cd873f498..c90cbdcc711 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-20  Tobias Burnus  <tobias@codesourcery.com>
+
+	PR libgomp/94251
+	* target.c (gomp_load_image_to_device): Fix link
+	variable handling.
+
 2020-03-19  Jakub Jelinek  <jakub@redhat.com>
 
 	PR c++/93931
diff --git a/libgomp/target.c b/libgomp/target.c
index 0ff727de47d..c99dd5196fa 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -1648,8 +1648,9 @@ gomp_load_image_to_device (struct gomp_device_descr *devicep, unsigned version,
     {
       struct addr_pair *target_var = &target_table[num_funcs + i];
       uintptr_t target_size = target_var->end - target_var->start;
+      bool is_link_var = link_bit & (uintptr_t) host_var_table[i * 2 + 1];
 
-      if ((uintptr_t) host_var_table[i * 2 + 1] != target_size)
+      if (!is_link_var && (uintptr_t) host_var_table[i * 2 + 1] != target_size)
 	{
 	  gomp_mutex_unlock (&devicep->lock);
 	  if (is_register_lock)
@@ -1663,7 +1664,7 @@ gomp_load_image_to_device (struct gomp_device_descr *devicep, unsigned version,
 	= k->host_start + (size_mask & (uintptr_t) host_var_table[i * 2 + 1]);
       k->tgt = tgt;
       k->tgt_offset = target_var->start;
-      k->refcount = target_size & link_bit ? REFCOUNT_LINK : REFCOUNT_INFINITY;
+      k->refcount = is_link_var ? REFCOUNT_LINK : REFCOUNT_INFINITY;
       k->virtual_refcount = 0;
       k->aux = NULL;
       array->left = NULL;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-25 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 15:11 [gcc(refs/users/marxin/heads/vect_cond_expr-rework-v3)] libgomp – fix declare target link handling (PR94251) Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).