public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-modules] [OpenACC] Remove 'tgt' reference counting from 'acc_unmap_data' [PR92854]
@ 2020-06-11 13:16 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-06-11 13:16 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4662f7fe7863b19fcc20ba58c22880f8d6661f3a

commit 4662f7fe7863b19fcc20ba58c22880f8d6661f3a
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Fri May 29 14:12:16 2020 +0200

    [OpenACC] Remove 'tgt' reference counting from 'acc_unmap_data' [PR92854]
    
            libgomp/
            PR libgomp/92854
            * oacc-mem.c (acc_unmap_data): Remove 'tgt' reference counting.

Diff:
---
 libgomp/oacc-mem.c | 14 +++++++-------
 1 file 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);


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

only message in thread, other threads:[~2020-06-11 13:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 13:16 [gcc/devel/c++-modules] [OpenACC] Remove 'tgt' reference counting from 'acc_unmap_data' [PR92854] Nathan Sidwell

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).