[flang-commits] [flang] [flang][OpenMP] Make sure that exec METADIRECTIVE is in execution part (PR #233147)
Abid Qadeer via flang-commits
flang-commits at lists.llvm.org
Tue Oct 20 01:46:32 PDT 2026
abidh wrote:
> > The other thing is that ` !$omp error at(execution)` does not generate an error but something like `!$omp metadirective when(user={condition(.true.)}: error at(execution))` still does. Is this discrepancy intentional?
>
> The second one crashes for me before and after this patch. It hits some assertion in lowering, seems like the code there is not handling the ERROR directive. This PR was not intended to change that, so the behavior of that remains the same.
Sorry I was not clear in my comment. Please look at the following testcase:
```
subroutine f
integer :: x
!$omp metadirective when(user={condition(.true.)}: error at(execution))
x = 1
print *, x
end
```
It gives the following error with -fsyntax-only which seems to suggest it is being treated as in specification part.
```
flang -fsyntax-only -fopenmp -fopenmp-version=51 test.f90
warning: OpenMP support for version 51 in flang is still incomplete [-Wexperimental-option]
error: Semantic errors in test.f90
test.f90:3:60: error: The ERROR directive with AT(EXECUTION) cannot appear in the specification part
!$omp metadirective when(user={condition(.true.)}: error at(execution))
```
while the following is clean with the same command
```
subroutine f
integer :: x
!$omp error at(execution)
x = 1
print *, x
end
```
https://github.com/llvm/llvm-project/pull/233147
More information about the flang-commits
mailing list