[flang-commits] [flang] [Flang][OpenMP] Allow copyprivate and nowait on the directive clauses (PR #127769)
Michael Klemm via flang-commits
flang-commits at lists.llvm.org
Sat Mar 1 02:37:47 PST 2025
mjklemm wrote:
> Error:
>
> ```
> $ flang x.f90 -fopenmp
> flang-21: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
> error: Semantic errors in x.f90
> ./x.f90:2:18: error: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive
> !$omp single nowait
> ^^^^^^
> ./x.f90:4:40: warning: NOWAIT clause is already used on the SINGLE directive
> !$omp end single copyprivate(x, y) nowait
> ^^^^^^
> ```
>
> Is the error and the warning correct and expected?
I think this is a bug. I do not see any restriction in the OpenMP specification that would disallow NOWAIT when COPYPRIVATE is present.
However, the compiler should produce an error that you have NOWAIT at both the begin and end directive. Only for the COPYPRIVATE clause the diagnostic should be a warning. I consider NOWAIT at both directives an actual error, because NOWAIT is a unique clause as per [5.2:308:10].
https://github.com/llvm/llvm-project/pull/127769
More information about the flang-commits
mailing list