<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82082>82082</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Incorrect diagnose for DATA statement
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
flang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DanielCChen
</td>
</tr>
</table>
<pre>
Consider the following code:
```
PROGRAM Misc7
INTEGER A(3), B, C(3)
DATA A(1:2) /2*1/ A(2:3) /2*2/
DATA C /3*1/ C /3*2/
DATA B /1/ B /2/
PRINT*, A
PRINT*, C
PRINT*, B
IF (ANY(A(1:1) .NE. 1 )) ERROR STOP 11
IF (ANY(A(2:3) .NE. 2 )) ERROR STOP 12
IF (ANY(C(1:3) .NE. 2 )) ERROR STOP 13
IF (B .NE. 2 ) ERROR STOP 14
END
```
Flang currently issues error messages
```
54:11: error: DATA statement initializations affect 'a(2_8)' more than once
INTEGER A(3), B, C(3)
^
54:17: error: DATA statement initializations affect 'b' more than once
INTEGER A(3), B, C(3)
^
54:20: error: DATA statement initializations affect 'c(1_8)' more than once
INTEGER A(3), B, C(3)
^
```
It doesn't seem correct to me.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVEGPszYQ_TXDZfRFeBxCOHAgJKxy2OwqzaWnygFDXIG9sp1W219fmZBsd5tuP60WIYNn5o3fs8cjnFOdljKHZAXJOhJnfzI2XwutZF-WJ6mjo2le89Jopxpp0Z8ktqbvzZ9Kd1ibRgIvIF5DXMAint5xivi8f3rYF4_4qFydXo3b3WHzsNljAbTkQBlQiaswlFfDJXBdHIoxiAEvCChDoIqACgZUjQ4CXvB_OAiouq4yosvg4VfIbfavuFXwjDGrKVf1JmG7OwAVgWBxz1jeM65uYisEWha7X8M4aWGB8my3mSHDUX-Gm_3-aY-_HJ6ekbH_wt7kjli6h6V72HJa93-w_D12hbfnDYPvEPPp2CfcZre-WweXsepFqJeztVL7_hWVc2fpUFprLA7SOdFJdxefzMOmBQWX6PAzHpvzwstBao9KK69Er_4SXhntULStrD0CpSJs3G_LUW-Kg7ES_UloNLqWV-I_X5OQbKa_C6n0a6SO38Hlk-cDTYq_RrMOhfP53n0D2Xd8P7aQy2frsTHSaaDUo5NywNpYG1h6g4OcRU3Om4xnIpI5S-Ml43HCWXTK44VoklS2MuXtIuVplgjWtHwxj0nIllOkcoppHhNL43hOjM3qxbFuecoFY7XIMoJ5LAeh-lnf_zHMjO2isXDzJcVLinpxlL0beyfR8dwBEVAJRG2oduBFa432UjfBkawjm4c0P47nzsE87pXz7i2xV74f-_B4VSBZ41ZfdTZKdNq40HrthwOMzrbPT96_uNCIqQKqOuVP5-OsNgNQFfJPnx8v1vwuaw9UXa4fUDUK-TsAAP__hOuUNg">