<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64315>64315</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang][hlfir] fir.char_convert verification failure
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:ir,
crash
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
cabreraam
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vzakhari
</td>
</tr>
</table>
<pre>
Reproducer:
```
subroutine test(c,n)
character(*,4),intent(in) :: c(:)
integer,intent(in) :: n
interface
subroutine callee(c)
character(*),intent(in) :: c(:)
end subroutine callee
end interface
call show([character(n)::c])
end subroutine test
subroutine test2(x)
integer,intent(in) :: x
character(kind=4) :: cx
cx = achar(x)
end subroutine test2
```
flang-new -flang-experimental-hlfir repro.f90:
```
error: loc("repro.f90":9:3): 'fir.char_convert' op operand #0 must be any reference, but got '!fir.boxchar<4>'
error: loc("repro.f90":15:3): 'fir.char_convert' op operand #0 must be any reference, but got '!hlfir.expr<!fir.char<1>>'
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0lN9y4joMxp9GudHAJHKSkotcUDg8wHmBHcdRiLfGZmyH0n36HQfasi2d2V7sDMOfWPr002chGYLeW-YWqkcgUrLz7KU8ABFU20xOcXS-Pf2ST6P0Outc_9L-z0fv-kmxB7GGfAv5Gur8-pp_hqnzboraMkYOEWilgDYWqLmcI6pReqkie6AV0BpoU6ZT2mgb2aYMncIxVRBrVClMrG8EUtw-pX-RYW8D_SAVvz5AxBs-JY1hvhC-in-C-w4YIrLt75S4nqfDT0wpBMPonpNc9XgLMLs2F1NQbd8Kfagx23y5ins3QECr8zfcO99x4knbHsS2vO3-_NbAGUFsUaaEP2rd4aS7M3N5H4y0-4XlZ1xcvvL5yF4f2EZpFqMZtEef5m85NPlX48feuzSbaNx8P0TvKUQg1slQcfEVgR4G7ZcJ_Idy9sQ-Aj2gO6I7spe2RyCR42EKETtGaV_Q88CerWKgDXZTxL2LSQeoSFKdO882iE0J4r_0_O-oiuqfYc3GLfl8TFRXzCtjkRhvMN-8zPpW9I1oZMZtUTd5U1BTltnYUrPqiQvZP1RC5ZKGgauyU6LMh67Ja8p0SzmJfJUXxSonKpf1oOpKqapfMYm6HqDM-SC1WRpzOiyd32c6hInbuhRFlRnZsQnXjTRPAYi19skk2qQl5WUYrwvKt0li0U37AGVudIjhXTTqaObNdhGptlA9zk5AtcWP7uKJvR60klE7i4PUZvKcTd60Y4zHMP_Jd0C7vY7j1C2VOwDtUqnrx-Lo3U9WEWg3NxOAdnM_vwMAAP__4J2XvQ">