[Bug libgomp/81591] segmentation fault when using priorities of nested tasks
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Aug 1 14:34:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81591
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly adjusted testcase - no headers, no VLAs, etc.:
int
main ()
{
#define MT 4
int a[MT * MT];
for (int i = 0; i < MT * MT; i++)
a[i] = 0;
#pragma omp parallel
#pragma omp master
{
for (int k = 0; k < MT; k++)
{
int *a0 = &a[k * MT + k];
int *a2 = &a[k * MT + MT - 1];
#pragma omp task depend(inout:a0[0:1]) \
depend(inout:a2[0:1]) priority(1)
{
#pragma omp taskloop num_tasks(MT - k) priority(2)
for (int m = k; m < MT; m++)
a[k * MT + m] += 1;
#pragma omp taskwait
}
}
}
for (int i = 0; i < MT * MT; i++)
if (a[i] != ((i % MT) >= (i / MT)))
__builtin_abort ();
return 0;
}
More information about the Gcc-bugs
mailing list