-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[Flang][OpenMP] Assertion `success && "Privatization failed due to existing binding"' failed. (parallel sections directive) #135108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
The fact that the same loop variable is used in both the first and second loop in the reproducer may be essential. In fact, the following program compiles without any problems. !$omp parallel sections
!$omp section
do i = 1, 2
end do
!$omp section
do j = 1, 2
end do
!$omp end parallel sections
end |
@llvm/issue-subscribers-flang-ir Author: None (k-arrows)
Reproducer:
```f90
!$omp parallel sections
!$omp section
do i = 1, 2
end do
!$omp section
do i = 1, 2
end do
!$omp end parallel sections
end
```
With assertion-disabled flang, the following output is obtained: flang-21: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
error: loc("/app/example.f90":6:5): operand #<!-- -->1 does not dominate this use
error: verification of lowering to FIR failed
Compiler returned: 1 With assertion-enabled flang, the reproducer hits the following assertion: flang: /path_to_project/llvm-project/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp:152: void Fortran::lower::omp::DataSharingProcessor::cloneSymbol(const semantics::Symbol *): Assertion `success && "Privatization failed due to existing binding"' failed. |
tblah
added a commit
to tblah/llvm-project
that referenced
this issue
May 1, 2025
This now produces code equivalent to if there was an explicit private clause on the SECTIONS construct. The problem was that each SECTION construct got its own DSP, which tried to privatize the same symbol for that SECTION. Privatization for SECTION(S) happens on the outer SECTION construct and so the outer construct's DSP should be shared. Fixes llvm#135108
tblah
added a commit
that referenced
this issue
May 8, 2025
This now produces code equivalent to if there was an explicit private clause on the SECTIONS construct. The problem was that each SECTION construct got its own DSP, which tried to privatize the same symbol for that SECTION. Privatization for SECTION(S) happens on the outer SECTION construct and so the outer construct's DSP should be shared. Fixes #135108
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproducer:
With assertion-disabled flang, the following output is obtained:
https://godbolt.org/z/GbfW7vYKj
With assertion-enabled flang, the reproducer hits the following assertion:
flang: /path_to_project/llvm-project/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp:152: void Fortran::lower::omp::DataSharingProcessor::cloneSymbol(const semantics::Symbol *): Assertion `success && "Privatization failed due to existing binding"' failed.
The text was updated successfully, but these errors were encountered: