<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121686>121686</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] failure in HLFIR bufferization pass
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Reproducer(`test.f90`):
```f90
type t
integer, allocatable :: a(:,:)
end type
type(t) :: str(1)
integer, allocatable :: b(:,:)
allocate(str(1)%a(1,1), b(1,1))
where((/.true./))str=(/(t(reshape((/b/), (/1,1/))), i=1,1)/)
end
```
The following is the result of `flang-new test.f90`:
```console
error: loc("/tmp/test.f90":9:1): failed to legalize operation 'hlfir.exactly_once'
error: failure in HLFIR bufferization pass
error: Lowering to LLVM IR failed
error: loc("/tmp/test.f90":1:1): cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface` registration for dialect for op: func.func
error: failed to create the LLVM module
```
The above failure is also reproducible on Godbolt:
https://godbolt.org/z/9GxGY64rz
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVFGPtCYU_TX4crMGcdTxwQc7E7ebbF82X5r0qUG8Ki0DBnDn2_31DeJ0ptumaRODCPeee-45IHdOThqxIcUPpDgnfPWzsc3vT9xac3VJb4aP5g0Xa4ZVoCXsSErq0fl0rCkpKWE1yVtC2zDfnrBOW_-xIHhCWwAAqT1OIfkEXCkjuOe9QgiJeQs8gOYtYadtrAltUQ8QEAJuxCLs6AmrbznOBypZjP53-P7v8HtUAH0AYgWP01P8PG2p9-86srnOaEPm9nSptyumhHUxJMDl57gVKR8tupkv94z-FnyCuLBX2BH2LUny871096csj0pHPt9mhNEoZa5STyAd-BnBoluVBzNCcERxPT1pvMKjcX91TRjtjAqCo7XGBuGUERtBRljnL0sYb-mMkbwNxmfRfxi5VDiAN6Bw4kp-IpgFLffSaCCsmtUobYrfufDq41ejBRJWPRYLAKtFkBp-fO1e3qBfxxGt_IwQC3fuMfzVXNGGfr2B19eff4KXt53D_-kge-hAcK2Nhx5BGP2O1sd2dvAQcZHOhZKkpGH1m-XaqY3eWXKFwr9oj3bkAklJweIknd8VGI2FIQZtc7NsPa9apGH4KkQsLSxyj5udG4uLGdbNoX84ALw373gX0QFXzoDd760M18FoeDZDb5SP1s_eL267Eh1h3RS3UmMnwrpPwrr6-fvzL-XBfhLaJkOTD3Ve8wSbrMpLWh5rWiVzc-xrWhWVYCKr6mqko8hYL0RdsByzoeeJbBhlBc1oQWuWHaqUl-OhKo6iHyrssS7JgeKFS5Uq9X4J5RPp3IpNxrLyWCaK96jc7e9kmxD11K-TIweqpPPunuelV9t_rAvnnRTn_3KoktWq5osU0s9rnwpzIawL6PvrabHmNxSesG6j6MLdjSzfG_ZHAAAA___9MpZR">