<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124043>124043</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] flang/lib/Lower/ConvertCall.cpp:1252: auto prepare[Flang] Assertion `baseBoxTy && "expect non simply contiguous variables to be boxes"' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Crash itself is reproducible on Godbolt:
https://godbolt.org/z/dWrxK9nnq
Reproducer:
```f90
type t
real, dimension(1:10) :: m
end type
real :: y = 1.0
type(t), allocatable :: b
allocate(b)
b%m = (/0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0/)
associate(a => b%m(4:8:2) * f(y))
call s(a)
end associate
contains
subroutine s(d)
real, dimension(1:2) :: d
end subroutine
end
real function f(x)
real :: x
f = x
end
```
With assertion-enabled flang-new, the compilation results in the following assertion failure:
```txt
llvm-project/flang/lib/Lower/ConvertCall.cpp:1252: auto preparePresentUserCallActualArgument(mlir::Location, fir::FirOpBuilder &, const Fortran::lower::PreparedActualArgument &, mlir::Type, const Fortran::lower::CallerInterface::PassedEntity &, (anonymous namespace)::CallContext &)::(anonymous class)::operator()(hlfir::Entity, bool) const: Assertion `baseBoxTy && "expect non simply contiguous variables to be boxes"' failed.
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VVGvozYT_TWTF-tGMEAuPPDAzV0-fepKXVVb7bOBIXFrbGqbe5P--moMucmuVPWhqhRNiD1zzszh2JHeq5MhqqF4geJ1J5dwtq7-_Uk6Z9_9rrPDtT466c9CBU96FMoLR7Ozw9KrTpOwRvzPDp3VAbIGkuYcwuz5EVvA9rRu7a07AbZ_ArbDN3f5qTLmD0g4_ZcNi9xaDodk_YxVAkkTrjOJAEkjHEkNeBSDmsh4ZQ1g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