When the argument is a parent component the box needs to
be updated to reflect the correct type. Use updateBoxForParentComponent
to update the argument accordingly.
Depends on D145907
Differential D145928
[flang] Handle parent component in user function argument clementval on Mar 13 2023, 5:39 AM. Authored by
Details When the argument is a parent component the box needs to Depends on D145907
Diff Detail
Event TimelineComment Actions I get errors from check-flang: ******************** TEST 'Flang :: Lower/polymorphic.f90' FAILED ******************** Script: -- : 'RUN: at line 1'; bbc -polymorphic-type -emit-fir /local/home/psteinfeld/main/928/flang/test/Lower/polymorphic.f90 -o - | /local/home/psteinfeld/main/928/build/bin/FileCheck /local/home/psteinfeld/main/928/flang/test/Lower/polymorphic.f90 -- Exit Code: 2 Command Output (stderr): -- bbc: /local/home/psteinfeld/main/928/llvm/include/llvm/Support/Casting.h:663: decltype(auto) llvm::dyn_cast(From*) [with To = fir::EmboxOp; From = mlir::Operation]: Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed. PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. Program arguments: bbc -polymorphic-type -emit-fir /local/home/psteinfeld/main/928/flang/test/Lower/polymorphic.f90 -o - #0 0x0000563e3b5b253b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/local/home/psteinfeld/main/928/build/bin/bbc+0x1c7b53b) #1 0x0000563e3b5afdb4 SignalHandler(int) Signals.cpp:0:0 #2 0x0000147555a4fc20 __restore_rt sigaction.c:0:0 #3 0x000014755423e37f raise (/lib64/libc.so.6+0x3737f) #4 0x0000147554228db5 abort (/lib64/libc.so.6+0x21db5) #5 0x0000147554228c89 _nl_load_domain.cold.0 loadmsgcat.c:0:0 #6 0x0000147554236a76 .annobin___GI___assert_fail.end assert.c:0:0 #7 0x0000563e3a86bc36 Fortran::lower::updateBoxForParentComponent(Fortran::lower::AbstractConverter&, fir::ExtendedValue, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) (/local/home/psteinfeld/main/928/build/bin/bbc+0xf34c36) #8 0x0000563e3a95b16a (anonymous namespace)::ScalarExprLowering::genRawProcedureRef(Fortran::evaluate::ProcedureRef const&, std::optional<mlir::Type>) ConvertExpr.cpp:0:0 #9 0x0000563e3a95b7d3 (anonymous namespace)::ScalarExprLowering::genProcedureRef(Fortran::evaluate::ProcedureRef const&, std::optional<mlir::Type>) ConvertExpr.cpp:0:0 |