https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96837

--- Comment #2 from Olaf Krzikalla <olaf.krzikalla at dlr dot de> ---
This raises the question, if a false "if" clause creates a parallel region
anyway. I haven't found a explicit statement in the OpenMP standard. 

However note, that the assertion "!omp_in_parallel()" in my example holds for a
false if-clause. Thus, for an observer there is no nested parallelism involved.
Conclusion: in one way or another libgomp does something wrong here. Either it
creates a parallel region but returns false for omp_in_parallel(), or it
doesn't create a parallel region, but doesn't behave like it. 

>From a user perspective I'd like to have a behavior, which just ignores a
openmp statement, if the "if" clause resolves to false. This means for the
current case, that no parallel region is created (and nothing happens
internally, too) and omp_in_parallel() returns false.

Reply via email to