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

    <tr>
        <th>Summary</th>
        <td>
            [flang] problem with multiple allocation
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Original test code:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90

For sake of simplicity, I modified the original test code:
```console
$ cat multiple_allocation_1_modify.f90
program alloc_test
  implicit none
 integer :: i
  integer, allocatable :: a(:)

  allocate(a(4))
 allocate(a(3),stat=i)
  print *, size(a)

end program
```

Result (gfortran vs flang-new)
```console
$ gfortran multiple_allocation_1_modify.f90
$ ./a.out
 4

$ flang-new -flang-experimental-exec multiple_allocation_1_modify.f90
$ ./a.out
 3
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVF2PmzAQ_DXmZQUyhnDkgYf0IqQ-VeofiIxZyPaMjWxzH_31lSEf11OvqlQpSuL17MzsWLb0nkaD2LDdF7Y7JnIJZ-uap1Q6Z1980tn-rfnmaCQjNQT0AZTtkRUHxo-MH84hzD6uRMtEO1I4L12m7BQXSqUTOWfdtmCi7bTtmGgn6QPeq5HVLxQwVgbrgpMm68cIXHSgWeNJam2VDGTNKc-GPd_Et-_WOvDyCcEO4GmaNSkKb0w8wleYbE8DYQ_hjGA_H4NVfPsoa7zVeKmKEpQM8Ecbp5X77e5mdnZ0coIVdIoaWx3gagqMNRdqIBNwRAfRQnEAumG3erR_UZOdxitMMlGvae_fJwBXKDJRR0gZAVfMx81i3Xz0QQZWHOmOg9mRCcDEIap7-nnp-E0LTQ-XST9E9x71Hf2iI1V9PVB49jBoacbU4Mud89Pcb33_Fn5syZhoZWaXa-7le0cRcNOHdPuLrzM6mtAEqVN8RfUfasWHiZK-Kfp9sZcJNnn1UFb7vKrq5NyUVS2rolL7ggvMVS8KsSvrjuc4lGU18IQawUXBc1Fxzh_KOstLyYe6FiirXS57xUqOkySdaf08ZdaNCXm_YFPxgheJlh1qv15oIeKw6yYTIt5v18SetFtGz0quyQd_ZwkU9PoSrOmw3TGedKdxghcK51s2cM8mWZxu_vIGROrLTzo7-wNVYKJdDXkm2tXwrwAAAP__QA9i3g">