Issue 91429
Summary [Flang] fatal internal error: CHECK(!start.IsTopLevel()) failed at /root/llvm-project/flang/lib/Semantics/tools.cpp(80)
Labels flang
Assignees
Reporter k-arrows
    Reproducible on Godbolt:
https://godbolt.org/z/fefT39bTe

Reproducer:
```console
$ cat test.f90
real x(f())
f() = 0.0
end
```

Stack dump:
```console
fatal internal error: CHECK(!start.IsTopLevel()) failed at /root/llvm-project/flang/lib/Semantics/tools.cpp(80)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -S -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -mllvm -x86-asm-syntax=intel -resource-dir /opt/compiler-explorer/clang-llvmflang-trunk-20240507/lib/clang/19 -mframe-pointer=all -o /app/output.s -x f95-cpp-input /app/example.f90
 #0 0x000000000377f328 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x377f328)
 #1 0x000000000377cc9c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007bd906a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007bd906a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007bd906a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007bd906a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x0000000004cef8e9 (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x4cef8e9)
 #7 0x0000000004131fb8 (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x4131fb8)
 #8 0x0000000004132a05 Fortran::semantics::IsHostAssociated(Fortran::semantics::Symbol const&, Fortran::semantics::Scope const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x4132a05)
 #9 0x000000000409cb05 Fortran::semantics::SubprogramVisitor::HandleStmtFunction(Fortran::parser::StmtFunctionStmt const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x409cb05)
#10 0x000000000409d0c8 void Fortran::parser::Walk<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false>, Fortran::semantics::ResolveNamesVisitor>(Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false>> const&, Fortran::semantics::ResolveNamesVisitor&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x409d0c8)
#11 0x00000000040a8fa5 void Fortran::parser::Walk<Fortran::parser::DeclarationConstruct, Fortran::semantics::ResolveNamesVisitor>(std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct>> const&, Fortran::semantics::ResolveNamesVisitor&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x40a8fa5)
#12 0x00000000040aa70d Fortran::semantics::ResolveNamesVisitor::Pre(Fortran::parser::SpecificationPart const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x40aa70d)
#13 0x00000000040a87a9 std::enable_if<TupleTrait<Fortran::parser::SpecificationPart>, void>::type Fortran::parser::Walk<Fortran::parser::SpecificationPart, Fortran::semantics::ResolveNamesVisitor>(Fortran::parser::SpecificationPart const&, Fortran::semantics::ResolveNamesVisitor&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x40a87a9)
#14 0x00000000040cf644 Fortran::semantics::ResolveNamesVisitor::ResolveSpecificationParts(Fortran::semantics::ProgramTree&) (.part.0) resolve-names.cpp:0:0
#15 0x00000000040cfcd6 Fortran::semantics::ResolveNamesVisitor::Pre(Fortran::parser::ProgramUnit const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x40cfcd6)
#16 0x00000000040d11e4 Fortran::semantics::ResolveNames(Fortran::semantics::SemanticsContext&, Fortran::parser::Program const&, Fortran::semantics::Scope&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x40d11e4)
#17 0x00000000041295e1 Fortran::semantics::Semantics::Perform() (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x41295e1)
#18 0x00000000037d01f5 Fortran::frontend::FrontendAction::runSemanticChecks() (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x37d01f5)
#19 0x0000000003af6cd2 Fortran::frontend::CodeGenAction::beginSourceFileAction() (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x3af6cd2)
#20 0x00000000037cf605 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x37cf605)
#21 0x00000000037bf077 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x37bf077)
#22 0x00000000037d564d Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x37d564d)
#23 0x0000000001f3c928 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x1f3c928)
#24 0x0000000001e2b804 main (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x1e2b804)
#25 0x00007bd906a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x00007bd906a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x0000000001f3b88e _start (/opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin/flang-new+0x1f3b88e)
flang-new: error: unable to execute command: Aborted (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git 6e5ed351be68017e46120b8ad1aa89d75b0ca204)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-llvmflang-trunk-20240507/bin
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to