This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix up target {{enter,exit} nowait,update} depend nowait


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.

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

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]