Skip to content
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

[Flang] Compilation failure in 621.wrf_s #58379

Closed
kiranchandramohan opened this issue Oct 15, 2022 · 4 comments
Closed

[Flang] Compilation failure in 621.wrf_s #58379

kiranchandramohan opened this issue Oct 15, 2022 · 4 comments
Assignees

Comments

@kiranchandramohan
Copy link
Contributor

kiranchandramohan commented Oct 15, 2022

Double use of module with OpenMP delcarative directive produces an error in MLIR translation.

Reproducer
Compiling the following code

module error
  integer :: err_message
  !$omp threadprivate (err_message)
end module error
MODULE lake
 USE error
contains
 SUBROUTINE lakesb
 USE error
 end subroutine lakesb
end MODULE lake

produces the error

error: loc("./tmp2.f90":8:2): Addressing symbol not found
error: loc("./tmp2.f90":8:2): LLVM Translation failed for operation: omp.threadprivate
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2022

@llvm/issue-subscribers-openmp

@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2022

@llvm/issue-subscribers-flang-ir

@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2022

@llvm/issue-subscribers-flang-frontend

@PeixinQiao
Copy link
Contributor

Thanks @kiranchandramohan for reporting this. Take up this.

sid8123 pushed a commit to sid8123/llvm-project that referenced this issue Oct 25, 2022
… lowering

The symbol may be used by use-association for multiple times such
as one in module specification part and one in module procedure.
Then in module procedure, the variable instantiation will be called
for multiple times. But we only need to threadprivatize it once and
use the threadprivatized value for the second time.

Fix llvm#58379.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D136035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants