llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.38k stars 11.73k forks source link

Error while trying to spill UDE from class O24: Cannot scavenge register without an emergency spill slot! #90787

Closed Orbisculating-Flerovium closed 5 months ago

Orbisculating-Flerovium commented 5 months ago

I was compiling my code and got the following error:

fatal error: error in backend: Error while trying to spill UDE from class O24: Cannot scavenge register without an emergency spill slot!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /opt/CEdev/bin/ez80-clang -S -mllvm -profile-guided-section-prefix=false -Oz -W -Wall -Wwrite-strings -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -Wno-main-return-type obj/lto.bc -o obj/lto.src
1.  Code generation
2.  Running pass 'Function Pass Manager' on module 'obj/lto.bc'.
3.  Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@playGame'
 #0 0x000000000176d293 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/CEdev/bin/ez80-clang+0x176d293)
 #1 0x000000000176b12e llvm::sys::RunSignalHandlers() (/opt/CEdev/bin/ez80-clang+0x176b12e)
 #2 0x000000000176c72d llvm::sys::CleanupOnSignal(unsigned long) (/opt/CEdev/bin/ez80-clang+0x176c72d)
 #3 0x00000000016f07aa (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) CrashRecoveryContext.cpp:0:0
 #4 0x00000000016f074b (/opt/CEdev/bin/ez80-clang+0x16f074b)
 #5 0x00000000017675a7 llvm::sys::Process::Exit(int, bool) (/opt/CEdev/bin/ez80-clang+0x17675a7)
 #6 0x00000000009b65e2 (/opt/CEdev/bin/ez80-clang+0x9b65e2)
 #7 0x00000000016f4458 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/CEdev/bin/ez80-clang+0x16f4458)
 #8 0x0000000000e9f81c (/opt/CEdev/bin/ez80-clang+0xe9f81c)
 #9 0x0000000000ea0090 llvm::RegScavenger::scavengeRegister(llvm::TargetRegisterClass const*, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, int, bool) (/opt/CEdev/bin/ez80-clang+0xea0090)
#10 0x00000000009d403d llvm::Z80InstrInfo::rewriteFrameIndex(llvm::MachineInstr&, unsigned int, llvm::Register, long, llvm::RegScavenger*, int) const (/opt/CEdev/bin/ez80-clang+0x9d403d)
#11 0x00000000009dfd68 llvm::Z80RegisterInfo::eliminateFrameIndex(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, int, unsigned int, llvm::RegScavenger*) const (/opt/CEdev/bin/ez80-clang+0x9dfd68)
#12 0x0000000000e5ea1e (anonymous namespace)::PEI::replaceFrameIndices(llvm::MachineBasicBlock*, llvm::MachineFunction&, int&) PrologEpilogInserter.cpp:0:0
#13 0x0000000000e5d239 (anonymous namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&) PrologEpilogInserter.cpp:0:0
#14 0x0000000000d541fe llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/CEdev/bin/ez80-clang+0xd541fe)
#15 0x000000000110acdd llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/CEdev/bin/ez80-clang+0x110acdd)
#16 0x0000000001110953 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/CEdev/bin/ez80-clang+0x1110953)
#17 0x000000000110b31f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/CEdev/bin/ez80-clang+0x110b31f)
#18 0x00000000019f6a34 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/CEdev/bin/ez80-clang+0x19f6a34)
#19 0x000000000261e16e clang::CodeGenAction::ExecuteAction() (/opt/CEdev/bin/ez80-clang+0x261e16e)
#20 0x000000000204e167 clang::FrontendAction::Execute() (/opt/CEdev/bin/ez80-clang+0x204e167)
#21 0x0000000001fc7f56 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/CEdev/bin/ez80-clang+0x1fc7f56)
#22 0x00000000020f2a8b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/CEdev/bin/ez80-clang+0x20f2a8b)
#23 0x00000000009b6298 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/CEdev/bin/ez80-clang+0x9b6298)
#24 0x00000000009b43cb ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#25 0x0000000001e4f922 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_1>(long) Job.cpp:0:0
#26 0x00000000016f072d llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/CEdev/bin/ez80-clang+0x16f072d)
#27 0x0000000001e4f454 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/opt/CEdev/bin/ez80-clang+0x1e4f454)
#28 0x0000000001e14fc4 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/CEdev/bin/ez80-clang+0x1e14fc4)
#29 0x0000000001e15457 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) const (/opt/CEdev/bin/ez80-clang+0x1e15457)
#30 0x0000000001e31bd8 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/CEdev/bin/ez80-clang+0x1e31bd8)
#31 0x00000000009b3ad7 main (/opt/CEdev/bin/ez80-clang+0x9b3ad7)
#32 0x00007f7084fadd0a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d0a)
#33 0x00000000009b10ca _start (/opt/CEdev/bin/ez80-clang+0x9b10ca)
clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 15.0.0 (https://github.com/jacobly0/llvm-project.git 005a99ce2569373524bd881207aa4a1e98a2b238)
Target: ez80
Thread model: posix
InstalledDir: /opt/CEdev/bin
clang-14: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
/opt/CEdev/meta/makefile.mk:334: recipe for target 'obj/lto.src' failed
make: *** [obj/lto.src] Error 1
Orbisculating-Flerovium commented 5 months ago

Never mind-- I tried to rename a file without changing the include header

asl commented 5 months ago
clang version 15.0.0 (https://github.com/jacobly0/llvm-project.git 005a99ce2569373524bd881207aa4a1e98a2b238)

This is not an official llvm / clang. And there is no Z80 backend upstream. Consider reporting to an appropriate downstream fork.

Orbisculating-Flerovium commented 5 months ago

My bad. I was using a 3rd party tool and I went to the link, not even seeing what repository I was adding the bug report to. I'll report to them.