Issue 150820
Summary [Flang] Assertion `!hostAssocTuple && val' failed.
Labels flang
Assignees
Reporter k-arrows
    With assertion-enabled flang, compiling the following program results in an assertion failure.

Reproducer:
```f90
integer i
contains
 subroutine s1
 contains
  subroutine s2
   j = i
  end subroutine
 end subroutine
end
```

Backtrace:
```console
 #0 0x00007b0e6f7b2787 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
 #1 0x00007b0e6f7afe85 llvm::sys::RunSignalHandlers()
 #2 0x00007b0e6f7b3535 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007b0e6ee42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007b0e6ee969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007b0e6ee969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007b0e6ee969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007b0e6ee42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007b0e6ee287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007b0e6ee2871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007b0e6ee39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00007b0e6b3353f8 
#12 0x00007b0e6b675cb1 Fortran::lower::HostAssociations::hostProcedureBindings(Fortran::lower::AbstractConverter&, Fortran::lower::SymMap&) 
#13 0x00007b0e6b37b828 (anonymous namespace)::FirConverter::startNewFunction(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#14 0x00007b0e6b37a156 (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#15 0x00007b0e6b37a1de (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#16 0x00007b0e6b330600 Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&) 
#17 0x00007b0e705a0ba4 Fortran::frontend::CodeGenAction::beginSourceFileAction() 
#18 0x00007b0e7059e29d Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) 
#19 0x00007b0e70451963 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) 
#20 0x00007b0e71562589 Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) 
#21 0x000061006f57d5ab fc1_main(llvm::ArrayRef<char const*>, char const*) 
#22 0x000061006f57baf2 main 
#23 0x00007b0e6ee29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#24 0x00007b0e6ee29e40 call_init ./csu/../csu/libc-start.c:128:20
#25 0x00007b0e6ee29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#26 0x000061006f57b4c5 _start 
flang-22: error: unable to execute command: Aborted (core dumped)
flang-22: error: flang frontend command failed due to signal (use -v to see invocation)
flang version 22.0.0git (https://github.com/llvm/llvm-project.git 5be31a82e2cc6f26fa94e5fc26bf051eb0636735)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```

Assertion:
```txt
flang: /path_to_project/llvm-project/flang/lib/Lower/Bridge.cpp:1101: virtual void (anonymous namespace)::FirConverter::bindHostAssocTuple(mlir::Value): Assertion `!hostAssocTuple && val' failed.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to