diff mbox

Fix up target {{enter,exit} nowait,update} depend nowait

Message ID 20151127193645.GR5675@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Nov. 27, 2015, 7:36 p.m. UTC
Hi!

I've recently changed the code so that GOMP_TARGET_TASK_DATA
depend nowait, if it doesn't need to wait for any dependencies,
is handled non-asynchronously, and before that the task created
because we didn't know if there are dependencies or not, is freed.
But, I forgot to remove the depend entries from the hash table, so there
would be stale entries pointing to freed memory.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk.

2015-11-27  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/68579
	* task.c (gomp_task_run_post_handle_depend_hash): New forward decl.
	(gomp_create_target_task): Call it before freeing
	GOMP_TARGET_TASK_DATA tasks.


	Jakub
diff mbox

Patch

--- libgomp/task.c.jj	2015-11-14 19:38:31.000000000 +0100
+++ libgomp/task.c	2015-11-27 11:26:23.796311905 +0100
@@ -585,6 +585,8 @@  GOMP_PLUGIN_target_task_completion (void
   gomp_mutex_unlock (&team->task_lock);
 }
 
+static void gomp_task_run_post_handle_depend_hash (struct gomp_task *);
+
 /* Called for nowait target tasks.  */
 
 bool
@@ -704,6 +706,7 @@  gomp_create_target_task (struct gomp_dev
     }
   if (state == GOMP_TARGET_TASK_DATA)
     {
+      gomp_task_run_post_handle_depend_hash (task);
       gomp_mutex_unlock (&team->task_lock);
       gomp_finish_task (task);
       free (task);