https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111017
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Looking at the dump, the only relevant change seems to be
.count.5 = 0;
which is now in a different basic block.
In the working case, it comes in a basic block executed shortly after the bb
containing the __builtin_omp_get_thread_num() call.
In the failing case it shifts from right before the following 'if' into the
'<bb 12>' - such that it is not executed if the condition is false:
if (0 != 0)
goto <bb 12>; [80.00%]
else
goto <bb 17>; [20.00%]