aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2020-05-29 14:12:16 +0200
committerThomas Schwinge <thomas@codesourcery.com>2020-06-04 18:56:37 +0200
commit4662f7fe7863b19fcc20ba58c22880f8d6661f3a (patch)
treeaaf97046d4e993441de431e81b207f8980c85667 /libgomp
parentaf8fd1a99d9a21f8088ebb11250cd06a3f275052 (diff)
[OpenACC] Remove 'tgt' reference counting from 'acc_unmap_data' [PR92854]
libgomp/ PR libgomp/92854 * oacc-mem.c (acc_unmap_data): Remove 'tgt' reference counting.
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/oacc-mem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c
index e2fb651a233..6314f5d8b68 100644
--- a/libgomp/oacc-mem.c
+++ b/libgomp/oacc-mem.c
@@ -477,13 +477,13 @@ acc_unmap_data (void *h)
gomp_mutex_unlock (&acc_dev->lock);
gomp_fatal ("cannot unmap target block");
}
- else if (tgt->refcount > 1)
- tgt->refcount--;
- else
- {
- free (tgt->array);
- free (tgt);
- }
+
+ /* Above, we've verified that the mapping must have been set up by
+ 'acc_map_data'. */
+ assert (tgt->refcount == 1);
+
+ free (tgt->array);
+ free (tgt);
gomp_mutex_unlock (&acc_dev->lock);