2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-13 13:01:02 +08:00

libgomp – fix declare target link handling (PR94251)

PR libgomp/94251
	* target.c (gomp_load_image_to_device): Fix link
	variable handling.
This commit is contained in:
Tobias Burnus 2020-03-23 15:29:05 +01:00
parent ce6413087d
commit 4897bb0045
2 changed files with 9 additions and 2 deletions

@ -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

@ -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;