https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97213
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Even with if(false) the implementation has to create a new data environment etc. if(false) just means the task will be included, i.e. the generating task will only continue when the included task finishes and the generating thread will execute the task. You'd need to add mergeable clause also to let the implementation for if(false) pretend there wasn't the task directive at all, but that is just an optimization option that GCC doesn't use right now (would require basically copying the region once again). Also, there is the overhead of the taskwait that you perform unconditionally at all levels.