Closed
Description
Reproducible on Godbolt:
https://godbolt.org/z/bexnKds9n
Reproducer:
integer :: i
i = 0
pr&
&i&
&nt *, i
end
Stack dump:
fatal internal error: CHECK(tokens.SizeInTokens() == 1) failed at /root/llvm-project/flang/lib/Parser/prescan.cpp(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-20240616/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-20240616/bin/.. -mframe-pointer=all -o /app/output.s -x f95-cpp-input /app/example.f90
#0 0x00000000038654d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38654d8)
#1 0x0000000003862e4c SignalHandler(int) Signals.cpp:0:0
#2 0x00007a1a6b442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007a1a6b4969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007a1a6b442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007a1a6b4287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x0000000004e72a29 (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4e72a29)
#7 0x0000000004ac4c72 Fortran::parser::Prescanner::Statement() (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4ac4c72)
#8 0x0000000004ac4d28 Fortran::parser::Prescanner::Prescan(Fortran::common::Interval<Fortran::parser::Provenance>) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4ac4d28)
#9 0x0000000004aac555 Fortran::parser::Parsing::Prescan(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Fortran::parser::Options) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4aac555)
#10 0x00000000038b7cb3 Fortran::frontend::FrontendAction::runPrescan() (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38b7cb3)
#11 0x0000000003be4bd0 Fortran::frontend::CodeGenAction::beginSourceFileAction() (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x3be4bd0)
#12 0x00000000038b6285 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38b6285)
#13 0x00000000038a5be7 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38a5be7)
#14 0x00000000038bc2cd Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38bc2cd)
#15 0x0000000001fee0a8 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x1fee0a8)
#16 0x0000000001ed6fe4 main (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x1ed6fe4)
#17 0x00007a1a6b429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#18 0x00007a1a6b429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#19 0x0000000001fed00e _start (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x1fed00e)
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 85a7bba7d28365ff98dae74f20ebf9f53d42023a)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin
The following is the original reproducer:
https://github.com/lfortran/lfortran/blob/main/integration_tests/line_continuation_02.f90