Skip to content

[Flang] fatal internal error: CHECK(isFunction()) failed at /root/llvm-project/flang/include/flang/Semantics/symbol.h(190) #86936

Closed
@k-arrows

Description

@k-arrows

Reproducible on Godbolt:
https://godbolt.org/z/ba11vdabv

Reproducer:

$ cat test.f90
interface
  subroutine s()
    real :: s
  end subroutine
end interface

s()=0.0
end

Stack dump:

fatal internal error: CHECK(isFunction()) failed at /root/llvm-project/flang/include/flang/Semantics/symbol.h(190)
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-20240328/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 -mframe-pointer=all -o /app/output.s -x f95-cpp-input /app/example.f90
 #0 0x000000000377c048 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x377c048)
 #1 0x00000000037799bc SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f9d1d442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f9d1d4969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007f9d1d442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007f9d1d4287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x0000000004bf5169 (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x4bf5169)
 #7 0x0000000004219be6 (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x4219be6)
 #8 0x000000000421fa17 Fortran::semantics::CheckHelper::Check(Fortran::semantics::Symbol const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x421fa17)
 #9 0x000000000421fc1c Fortran::semantics::CheckHelper::Check(Fortran::semantics::Scope const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x421fc1c)
#10 0x000000000421fc88 Fortran::semantics::CheckHelper::Check(Fortran::semantics::Scope const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x421fc88)
#11 0x0000000004220292 Fortran::semantics::CheckDeclarations(Fortran::semantics::SemanticsContext&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x4220292)
#12 0x000000000410e2e7 Fortran::semantics::Semantics::Perform() (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x410e2e7)
#13 0x00000000037c0497 Fortran::frontend::FrontendAction::runSemanticChecks() (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x37c0497)
#14 0x0000000003aeaff0 Fortran::frontend::CodeGenAction::beginSourceFileAction() (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x3aeaff0)
#15 0x00000000037bfa75 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x37bfa75)
#16 0x00000000037af827 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x37af827)
#17 0x00000000037c5cfd Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x37c5cfd)
#18 0x0000000001f5c6c8 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x1f5c6c8)
#19 0x0000000001e4d78d main (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x1e4d78d)
#20 0x00007f9d1d429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#21 0x00007f9d1d429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#22 0x0000000001f5b62e _start (/opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin/flang-new+0x1f5b62e)
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 0fda758f26c1ec06809fdc067cd65dc146f867d0)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-llvmflang-trunk-20240328/bin

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]flang:frontend

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions