<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58379>58379</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Compilation failure in 621.wrf_s
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kiranchandramohan
</td>
</tr>
</table>
<pre>
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:
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydU01vozAQ_TVwGS0iBhI4cEg3rVQp2VZts9fK2AN4azCyTav--x0g2X7tqZLBjOfjjd88KiNfy50ZK40wOgRTQ2fkSNaL8i3cDNgfbkGiFtxyr54RpLIo5q_BUqRAB7wHtNZYUD0c9td34C3vnaZ400dBvAvi7fK-w1OOXeyfphuUVn0DvkWojdbmZbKEkXjKW8enNZun3ma05QQI1GODFoJkS2vyPXboHG_wHBGwVcBSwiIYi1wOVj1zj3Sev49mxZKAvYSvQIeb3XF_CZo_nese7y_fBwjTe656d_LeHy_ubo4P17-WHFf9PwsmNDdW1oxe9fghdnJ9gf3EyL8hTAy-q_spbPEQPdoIunbAWBSwK98NLKqLmEzy5fSwiQUK20ppiZZpGO61q4yG3nia0NjL7xXc738f4OFNF1BzpVFSSQtmQDsfToE0pujDmBa82_3llpgjpjrlgUM1NmBxMNaDN9B6P7hJAOyKVkPSHatImI4MrZ_P2w8i6w-Jl0zl3IiOPki8kiQk9Chx5lBY7lqouHgiFQs86ffe0wHIsRsmlI8Mh1iu1ussTzebJAllmcgiKXjolddYBtnFleZ9E2Q7WOT-dv3R4vTLrNkqerH1owtHq8vvXyXLk00RtmUq0kTWmOdJnqRZJYpCYF7VhcxYscmxCDWvULupNeoqVCWLGVvFq2yVsTxLorQWMhPVKl5v0nXON0EaY0ftRhNwZGwT2nLugWbgyKmV8-7NyUk2TY94rs9H3xpbPikavmiJbss7Q3s4N17OXf8FfLpszg">