<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63772>63772</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang]Incorrect execution result of READ statement When pad='NO' is specified for OPEN statement
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:frontend
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 17.0.0(36999318f09122fa41baff838f46c753db078275)
```

When `pad='NO'` is specified for `OPEN` statement (io-unit = 11), `READ` statement (io-unit = 11) produces the following results:  
  - Flang-new reads a single character(c) into the variable(BUFF).  
  - Gfortran and ifort do not read a single character(c) in the variable(BUFF).  

When `pad='YES'`, Flang-new, Gfortran, and ifort have the same results. 

The following are the test program, results of Flang-new, Gfortran and ifort compilation and execution.


snggl252_8.f90:
```
program main
  INTEGER :: ISIZE
  CHARACTER (4) :: BUFF
  OPEN(11)
 write(11,'(a)')'c'
  close(11)
  BUFF='aaaa'
 OPEN(11,status='OLD',pad='NO')
 READ(11,'(A)',size=ISIZE,advance='NO',eor=300) BUFF
300 write(6,*) "300 ISIZE = ", ISIZE, " BUFF = ", BUFF
  CLOSE(11,status='delete')
end program main
```

```
$ flang-new snggl252_8.f90; ./a.out
 300 ISIZE =  1  BUFF = caaa
$
```

```
$ gfortran snggl252_8.f90; ./a.out
 300 ISIZE =            0  BUFF = aaaa
$
```

```
$ ifort snggl252_8.f90; ./a.out
 300 ISIZE =            0  BUFF = aaaa
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VV1v7CYQ_TX4Ba2FwZ8PftjYu7eRrpIqSVu1LxWLx16uvLACnLT99RXYm_24aa9uHxpFrIHhzJnDzMCtlYMCqFF2h7I24pPba1PrvdKr_ku0092fNcrJ8k9aRNY_g7FSK6x73I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