Issue 124043
Summary [Flang] flang/lib/Lower/ConvertCall.cpp:1252: auto prepare[Flang] Assertion `baseBoxTy && "expect non simply contiguous variables to be boxes"' failed.
Labels flang
Assignees
Reporter k-arrows
    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.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to