__kmp_free_task: Fix for serial explicit tasks producing proxy tasks
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Mon, 8 Aug 2016 10:08:07 +0000 (10:08 +0000)
committerJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Mon, 8 Aug 2016 10:08:07 +0000 (10:08 +0000)
commit69f8511f8f47c7fab6c8dda663d394b4176f93e5
tree08edc65cf1a54fa59516140562f5809953bbbc6b
parentcae9aeed3934c1f97d8628732bcd58968fe52656
__kmp_free_task: Fix for serial explicit tasks producing proxy tasks

Consider the following code which may be executed by a serial team:

    int dep;
    #pragma omp target nowait depend(out: dep)
    {
        sleep(1);
    }
    #pragma omp task depend(in: dep)
    {
        #pragma omp target nowait
        {
            sleep(1);
        }
    }

Here the explicit task may not be freed until the nested proxy task has
finished. The current code hasn't considered this and called __kmp_free_task
anyway which triggered an assert because of remaining incomplete children:

    KMP_DEBUG_ASSERT( TCR_4(taskdata->td_incomplete_child_tasks) == 0 );

Differential Revision: https://reviews.llvm.org/D23115

llvm-svn: 277991
openmp/runtime/src/kmp_tasking.c
openmp/runtime/test/tasking/bug_nested_proxy_task.c [new file with mode: 0644]