<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63396>63396</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Incorrect execution result when array sections are passed as actual arguments
</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)
```
An array section passed as an actual argument has an incorrect result in the operation in subroutine.
The following are the test program, results of Flang-new, Gfortran and ifort compilation and execution.
snggm602_2.f90:
```fortran
program main
call s1
print *,'pass'
end program main
subroutine s1
integer,target:: t(3)=(/1,2,3/)
write(6,*) "before : t = ", t
call x(t(2:3),t(1:2))
write(6,*) "after : t = ", t
if (any(t/=(/1,1,2/)))print *,'error'
contains
subroutine x(z1,z2)
integer,target:: z1(:),z2(:)
z1=z2
end subroutine x
end subroutine s1
```
```
$ flang-new -flang-experimental-exec snggm602_2.f90; ./a.out
before : t = 1 2 3
after : t = 1 1 1
error
pass
$
```
```
$ gfortran snggm602_2.f90; ./a.out
before : t = 1 2 3
after : t = 1 1 2
pass
$
```
```
$ ifort snggm602_2.f90; ./a.out
before : t = 1 2 3
after : t = 1 1 2
pass
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VV2PszgP_TXhxioCZ6DhggueVrx671d7u0rA0DyiSZWEnY9fvwrQTqczo9V-aNuKxg45x8dOYum9Hg1RzYofrDgmcg4n62p7MnY3_EyU7V9rVmbbLzuyrPmVnNfWgB1gmKQZd4aegfEG8n2apRlDMZSdkIKqTu17oYRUigtUBXZCDArFXpYD7iUqhtUK-cCwPhsD0jn5Cp66EAkv0nvqQXqQBmQXZjmBdON8JhPgtLq16axz1AVw5OcpgDYQTgT2Qk4uKNqAn5Wzc9CG0nvCX04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