Runtime aborts when OMP_THREAD_LIMIT is set and "target teams" construct is used

Hi,

I have this program:

#define N 100

int main()

{

int x[N], y[N];

for (int i = 0; i < N; i++) {

y[i] = 1;

x[i] = 1;

}

#pragma omp target teams distribute parallel for

for (int i = 0; i < N; i++){

y[i] += x[i];

}

}

Compile and run in this way:

$ clang -fopenmp -fopenmp-targets=x86_64-unknown-linux-gnu test.c -lomptarget

$ OMP_THREAD_LIMIT=8 OMP_TARGET_OFFLOAD=DISABLED ./a.out

OMP: Warning #96: Cannot form a team with 80 threads, using 8 instead.

OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set).

Segmentation fault (core dumped)

I get the warning, but why does the runtime aborts?

Is this situation described in the Spec? I could not find anything specific.

I am using Clang/LLVM/OpenMP 8.0.1.

Thanks.

Simone

Submitted a bug here: https://bugs.llvm.org/show_bug.cgi?id=42906

Thanks!

Simone