https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96837
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- That is not about if(false), but rather about nested parallelism. libgomp has a thread cache only for the outermost parallel level, with nested parallelism the threads are spawned and joined each time a parallel is encountered. A thread cache is effectively required by the standard for the outermost parallelism due to the requirement on threadprivate vars preservation, for nested parallelism thread caching is possible with some work on the library side, but the question is when in such cases the pools should be freed, whether doing #pragma omp parallel num_threads(1024) #pragma omp parallel num_threads(1024) should keep around a million threads or not even when nested parallelism doesn't ever occur again in the program.