https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79940
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'll fix this, that said the testcase certainly is not OpenMP compliant, you have a data race in there, you need to do the taskloop just once, or make sure that in each thread it will write to different arrays or portions of an array. So easiest is just add #pragma omp single. But then, there is not really any benefit in using taskloop in that case, a normal #pragma omp parallel for would be faster.