https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98738
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think omp_fullfill_event needs to do much more than it does. Just look e.g. at what gomp_target_task_completion does. The function needs to find out in what state the task is (I'm afraid it needs to take the team->task_lock around that checking (if any)), if the task hasn't finished yet, it shouldn't need anything but sem_post but if it has already finished and it is just waiting for the completion event, it needs to handle taskwait, depend wait, taskgroup waits and barrier waits. Sorry for not catching that during patch review.