In 'libgomp/target.c:gomp_exit_data', remove open-coded 'gomp_remove_var'
authorThomas Schwinge <thomas@codesourcery.com>
Mon, 9 Dec 2019 11:39:57 +0000 (12:39 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Mon, 9 Dec 2019 11:39:57 +0000 (12:39 +0100)
libgomp/
* target.c (gomp_exit_data): Use 'gomp_remove_var'.

From-SVN: r279118

libgomp/ChangeLog
libgomp/target.c

index a0bd25177d118023045f6c97273ee07dd7fcd499..c5541bcec81dd0de9b5a450d298e96e7d1703b91 100644 (file)
@@ -1,3 +1,7 @@
+2019-12-09  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * target.c (gomp_exit_data): Use 'gomp_remove_var'.
+
 2019-12-09  Tobias Burnus  <tobias@codesourcery.com>
 
        * testsuite/libgomp.fortran/use_device_addr-3.f90: Make 'stop' codes
index 84d6daa76ca87b968f7ddbba18daded5e7ab505a..13f7921651fea9b12e9e58e2014daa6bc4eb669e 100644 (file)
@@ -2095,16 +2095,7 @@ gomp_exit_data (struct gomp_device_descr *devicep, size_t mapnum,
                                          - k->host_start),
                                cur_node.host_end - cur_node.host_start);
          if (k->refcount == 0)
-           {
-             splay_tree_remove (&devicep->mem_map, k);
-             if (k->link_key)
-               splay_tree_insert (&devicep->mem_map,
-                                  (splay_tree_node) k->link_key);
-             if (k->tgt->refcount > 1)
-               k->tgt->refcount--;
-             else
-               gomp_unmap_tgt (k->tgt);
-           }
+           gomp_remove_var (devicep, k);
 
          break;
        default: