https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89005

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative patch to remove initial element:
...
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index ff90b67cb86..cbabc8dba96 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -279,11 +279,7 @@ cuda_map_destroy (struct cuda_map *map)
 static bool
 map_init (struct ptx_stream *s)
 {
-  int size = getpagesize ();
-
-  assert (s);
-
-  s->map = cuda_map_create (size);
+  s->map = NULL;

   return true;
 }
@@ -291,9 +287,8 @@ map_init (struct ptx_stream *s)
 static bool
 map_fini (struct ptx_stream *s)
 {
-  assert (s->map->next == NULL);
-
-  cuda_map_destroy (s->map);
+  if (s->map)
+    cuda_map_destroy (s->map);

   return true;
 }
@@ -323,10 +318,9 @@ map_push (struct ptx_stream *s, size_t size)
   struct cuda_map **t;

   assert (s);
-  assert (s->map);

   /* Select an element to push.  */
-  if (s->map->active)
+  if (!s->map || s->map->active)
     map = cuda_map_create (size);
   else
     {
...

Passes libgomp.oacc-c/c.exp

Reply via email to