<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63512>63512</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Incorrect execution result of DATA 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(f6c8a8e9cb7d8b8abb382b52c88fb287a6f27a2b)
```
A result of initializing an array in `DATA` statement is incorrect.
If the array sections in the test program are reordered, the result is correct.
For example, in the following order
- Before the change
```
DATA ILA(1:3), ILA(4:3), ILA(4:5) /1,2,3,4,5/
```
- After the change
```
DATA ILA(1:3), ILA(4:5), ILA(4:3) /1,2,3,4,5/
```
The following are the test program, results of Flang-new, Gfortran and ifort compilation and execution.
p.f90:
```fortran
program main
INTEGER ILA(5)
DATA ILA(1:3), ILA(4:3), ILA(4:5) /1,2,3,4,5/
! DATA ILA(1:3), ILA(4:5), ILA(4:3) /1,2,3,4,5/
write(6,*) "ILA = ", ILA
end program main
```
```
$ flang-new -flang-experimental-exec p.f90; ./a.out
ILA = 1 2 3 0 0
$
```
```
$ gfortran p.f90; ./a.out
ILA = 1 2 3 4 5
$
```
```
$ ifort p.f90; ./a.out
ILA = 1 2 3 4 5
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VUGvozYQ_jXmMgqCISbmwIGXLKtIqx6qp94NDMQrx45sp-9tf31lQjbZt5HabFUrImY0_ubzzDeM9F5Nhqhm_IXxXSLP4WBdbQ_GrsavSWeHbzUrs-WX7VjW_EHOK2vAjjBqaaaVoTdgRQP5Js3SjKEYy15IQVXfbQbRCdl1hcCOYy_E2KHYyHLEjcSOYXWB_BDh8mzAkT_rEAMpo4KSWv2lzATSgHROfgNlgJXZrnmNAOCDDHQkE0B5UKa3zlEfUoAL3H6EcKDlpKc-KGui32wN5AOcnJ2cPIJ0BI6sG8jRwHA7eyxclIcr8AW2tQ7oXR5PmqLrgjdare1bJDvD3F9rBS80WkezX3-QZqKHSYjXgv2XhqHIWdEUMVm4XSzrhxbOsAKGbc5wiwy3BcPtmuGWM2wfxlhBMwZy_5kKf0juKSr3z9cfMiiXXN3XKAa7VMRHebRXHUb759G64KJIzAAqvkBvjyelZSz5bKV36s_xLf05-Ckdq4wVzQeWC-jisyjlKNViAdj_9vrp86fflxzw79oG-H8qifm_QP6VwgC8ORWIoSgZbhk2lxO4_9IAK3Zxe4Wc_ckM8HNCHpf3gxHXd5-Q1WVL7ydyKvax1KtYKFgq8gIpw1am9hwWoldGkANCARnccJ8jMV0l88-hbisGva3ibr--2_NfpHQR7nN8butHZk_wSYa6GKqikgnVeSk2G85zXiaHuifsOB9E1m-GSoix4IMss3FYV3zEMheJqjHDIiuxzNYcizIVQy55n4lKym5AWbJ1RkepdKr1n8fUuilR3p-pLgueY6JlR9rPYwhxVgIrmtFZE8gMUXJ8l7g6Hl1158mzdaaVD_4GFlTQ8xibPwaM72B_nQG3fr8bKXPvfJ8Zydnp-hDCycfWx5ZhO6lwOHdpb48M2xhm-VudnP1KfWDYzhfwDNv5Dn8HAAD__1PA7r8">