<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/150035>150035</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] I/O Runtime failure with `BLANK=zero` in READ
</td>
</tr>
<tr>
<th>Labels</th>
<td>
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:
```
implicit none
integer, parameter :: in = 11
real(4) :: rl4
real(8) :: rl8
complex(4) :: cx4
complex(8) :: cx8
open(in, file='modeBlankNaNInfIO002.dat', blank='zero')
! read the values in using BLANK mode of ZERO
read(in, *, blank='zero') rl4, rl8, cx4, cx8
! read the values in using BLANK mode of NULL
read(in, *, blank='null') rl4, rl8, cx4, cx8
! read the values in using BLANK mode of ZERO
read(in, *, blank='zero') rl4, rl8, cx4, cx8
close(in)
end
```
The `modeBlankNaNInfIO002.dat` is:
```
-NaN(Q) -NaN(S) ( +Inf ,+3.14 ) (Infinity , NaN(_abcd123) )
-NaN(Q) -NaN(S) ( +Inf ,+3.14 ) (Infinity , NaN(_abcd123) )
+NaN(S) +NaN(Q) ( -3.14 , -NaN() ) ( -Infinity , nan )
+NaN(S) +NaN(Q) ( -3.14 , -NaN() ) ( -Infinity , nan )
```
Flang failed at execution as:
```
> a.out
fatal Fortran runtime error(t.f:19): Bad real input data at column 44 of record 3
IOT/Abort trap(coredump)
```
Both gfortran and XLF executes the code successfully.
If I remove all of the `blank=` specifier from the `open` and `read` statements, it works fine.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8VV2L4zYU_TXKy2WMLNuJ8-AHJxlD6JCh0y2UvhTZuk7UlSUjyfPRX1-kOOlMmIVSujsMURSde8790hV3Th41YkWKDSl2Cz75k7HVjmuJars9oV60RrxVW6OdFGjBnxB6o5R5kfoInRFIsprQmizp_E9riH9yGJXspAdtNAbE9UB7PKIlbAs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