<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113311>113311</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][AIX][I/O]: Fortran runtime error when `print` array constructor with zero-length character elements.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
flang:runtime
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DanielCChen
</td>
</tr>
</table>
<pre>
Consider the following code
```
character(3) :: arr(2), arr2(2)
arr = ["aaa", "bbb"]
arr2 = [arr(:)(3:1)]
print*, arr2
print*, arr(:)(3:1)
print*, [arr(:)(3:1)] !! ERROR
end
```
On AIX, the line marked with ERROR issues
```
fatal Fortran runtime error(t.f:6): Bad address for I/O item -- null base address or subscripts out of range
```
The code runs fine on LoP.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U8GOozgQ_ZriUkoEZUKaAwc6WaSWVupVaw97NbgA7zh2ZJtu9Xz9yJDOHCZqCRmX9epV-dWzDEFPlrmBwzMczplc4ux8c5ZWszmdZrZZ79Rnc3I2aMUe48w4OmPch7YTDk4x5GfI29ta5bdvDYdZejlE9kBPAqhGEC2IFqVPJwRUA51SRF_hmia9RxBnTD0RSSmBKAGBqO_7FBzOdyR9QTfSVCHRPgkQbZG2X9ir1zYCtfeSj04fMvwB_LYaIlABVOBfb2-vb1syW_VQoG19tdi-_JeIk7pGW8aL9D9Y4YeO88aDOoSFw0OWUUZpsHM-emnRLzbqCyN771KPcT-CaKvUnGjxWSqUSnkOAUfn8QWoe0Ud-YK7HdrFGOxl4DvGeQxLHwavrzGgWyK6Eb20E39zoX9nXq2Regk4pgs5i3-7f_aZaoSqRS0zbooj1VUuqpqyuelZDnWhmMp6KAtV1nV-FCyORx6r4ShkphvKqSxyokLQU0F7qapSyb6shp77WjGUOV-kNntj3i9756dslawpCiGKIjOyZxOazVP9Mm2eAqLRSDuBaG-6bfbKfJNodv0yBShzo0MMv4mjjmZ9Mt2aezjD4TlNcN2siqataB_PBD9mtghVvlmqypPx5CcOzobolyEmSBr8T_ZuZ9hOccb7U0I2fGEbwz5bvGnmGK9htWEH1E06zku_H9wFqEvt3n67q3f_8xCBupuPqLvp8t7QrwAAAP__ENEseA">