[llvm-bugs] [Bug 45451] New: "Error while trying to spill R11 from class GPRC: Cannot scavenge register without an emergency spill slot!" building several ports

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 6 15:22:43 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45451

            Bug ID: 45451
           Summary: "Error while trying to spill R11 from class GPRC:
                    Cannot scavenge register without an emergency spill
                    slot!" building several ports
           Product: libraries
           Version: trunk
          Hardware: Macintosh
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: chmeeedalf at gmail.com
                CC: llvm-bugs at lists.llvm.org, nemanja.i.ibm at gmail.com

Created attachment 23316
  --> https://bugs.llvm.org/attachment.cgi?id=23316&action=edit
Best reduction I could get

The attached reduced test case comes from the math/fftw3 port, building for
powerpcspe.  Building with:

cc -target powerpcspe-unknown-freebsd -O2 -fPIC -mcpu=8548 file.i

Oddly, assembling the file, with those same arguments, to -emit-llvm, and then
running that through llc with

llc -mcpu=e500 -mtriple=powerpcspe-unknown-freebsd --relocation-model=pic
file.ll

it builds just fine.  So I'm not sure what is going on with clang that isn't
going on with llc, or if I'm not passing the right arguments to llc to create a
llvm reduced testcase.

Full trace:

fatal error: error in backend: Error while trying to spill R11 from class GPRC:
Cannot scavenge register without an emergency spill slot!                       
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.                      
Stack dump:                                                                     
0.      Program arguments: /ralga/scratch/chmeee/builds/llvm/bin/clang -target
powerpcspe-unknown-freebsd -O2 -mcpu=8548 n1_32.i -S -fPIC                      
1.      <eof> parser at end of file                                             
2.      Code generation                                                         
3.      Running pass 'Function Pass Manager' on module 'n1_32.i'.               
4.      Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on
function '@k'                                                                   
 #0 0x0000000817b32620 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/Unix/Signals.inc:564:13
 #1 0x0000000817b32ca4 PrintStackTraceSignalHandler(void*)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/Unix/Signals.inc:624:3              
 #2 0x0000000817b2fe10 llvm::sys::RunSignalHandlers()
/home/chmeee/llvm_git/llvm/llvm/lib/Support/Signals.cpp:67:5                    
 #3 0x0000000817b3156c llvm::sys::CleanupOnSignal(unsigned long)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/Unix/Signals.inc:361:3              
 #4 0x0000000817a37504 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:75:7
 #5 0x0000000817a37434 llvm::CrashRecoveryContext::HandleExit(int)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:436:3
 #6 0x0000000817b2c710 llvm::sys::Process::Exit(int)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/Process.cpp:95:10                   
 #7 0x0000000010025308 LLVMErrorHandler(void*, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)
/home/chmeee/llvm_git/llvm/clang/tools/driver/cc1_main.cpp:73:3                
                                                                               
                                                        #8 0x0000000817a486dc
llvm::report_fatal_error(llvm::Twine const&, bool)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/ErrorHandling.cpp:108:5
 #9 0x0000000817a48588 llvm::report_fatal_error(char const*, bool)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/ErrorHandling.cpp:83:3             
                                  #10 0x00000008153dd76c
llvm::RegScavenger::spill(llvm::Register, llvm::TargetRegisterClass const&,
int, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>,
llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&)
/home/chmeee/llvm_git/llvm/llvm/lib/CodeGen/RegisterScavenging.cpp:515:7
#11 0x00000008153de5b0
llvm::RegScavenger::scavengeRegisterBackwards(llvm::TargetRegisterClass const&,
llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, bool, int, bool)
/home/chmeee/llvm_git/llvm/llvm/lib/CodeGen/RegisterScavenging.cpp:611:30
#12 0x00000008153df5c4 scavengeVReg(llvm::MachineRegisterInfo&,
llvm::RegScavenger&, llvm::Register, bool)
/home/chmeee/llvm_git/llvm/llvm/lib/CodeGen/RegisterScavenging.cpp:668:22
#13 0x00000008153def20
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true,
true, void>, false, false>::operator*() const
/home/chmeee/llvm_git/llvm/llvm/include/llvm/ADT/ilist_iterator.h:138:5
#14 0x00000008153def20 llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>::operator*() const
/home/chmeee/llvm_git/llvm/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h:178:40
#15 0x00000008153def20 llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>::operator->() const
/home/chmeee/llvm_git/llvm/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h:179:40 
#16 0x00000008153def20
scavengeFrameVirtualRegsInBlock(llvm::MachineRegisterInfo&,
llvm::RegScavenger&, llvm::MachineBasicBlock&)
/home/chmeee/llvm_git/llvm/llvm/lib/CodeGen/RegisterScavenging.cpp:709:9        
#17 0x00000008153dea8c llvm::scavengeFrameVirtualRegs(llvm::MachineFunction&,
llvm::RegScavenger&)
/home/chmeee/llvm_git/llvm/llvm/lib/CodeGen/RegisterScavenging.cpp:769:9       
  #18 0x0000000815351be8 (anonymous
namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&)
/home/chmeee/llvm_git/llvm/llvm/lib/CodeGen/PrologEpilogInserter.cpp:275:5      
#19 0x0000000815212c8c
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/chmeee/llvm_git/llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:13
#20 0x000000081772acec llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/chmeee/llvm_git/llvm/llvm/lib/IR/LegacyPassManager.cpp:1482:27
#21 0x000000081772b158 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/chmeee/llvm_git/llvm/llvm/lib/IR/LegacyPassManager.cpp:1518:16
#22 0x000000081772b940 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/chmeee/llvm_git/llvm/llvm/lib/IR/LegacyPassManager.cpp:1583:27
#23 0x000000081772b940 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/chmeee/llvm_git/llvm/llvm/lib/IR/LegacyPassManager.cpp:1695:44
#24 0x000000081772bfa0 llvm::legacy::PassManager::run(llvm::Module&)
/home/chmeee/llvm_git/llvm/llvm/lib/IR/LegacyPassManager.cpp:1726:14
#25 0x00000008149e1a08 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >)
/home/chmeee/llvm_git/llvm/clang/lib/CodeGen/BackendUtil.cpp:939:19    
#26 0x00000008149e1a08 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) /home
/chmeee/llvm_git/llvm/clang/lib/CodeGen/BackendUtil.cpp:1624:15                 
#27 0x0000000814d0c678
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/chmeee/llvm_git/llvm/clang/lib/CodeGen/CodeGenAction.cpp:335:7            
#28 0x0000000819e29308 clang::ParseAST(clang::Sema&, bool, bool)
/home/chmeee/llvm_git/llvm/clang/lib/Parse/ParseAST.cpp:171:13                  
#29 0x00000008160bf41c clang::ASTFrontendAction::ExecuteAction()
/home/chmeee/llvm_git/llvm/clang/lib/Frontend/FrontendAction.cpp:1047:3
#30 0x0000000814d092ec clang::CodeGenAction::ExecuteAction()
/home/chmeee/llvm_git/llvm/clang/lib/CodeGen/CodeGenAction.cpp:1179:28          
#31 0x00000008160bea60 clang::FrontendAction::Execute()
/home/chmeee/llvm_git/llvm/clang/lib/Frontend/FrontendAction.cpp:940:8          
#32 0x000000081605c8b0
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/chmeee/llvm_git/llvm/clang/lib/Frontend/CompilerInstance.cpp:973:33       
#33 0x0000000813bcf64c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/chmeee/llvm_git/llvm/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:282:25 
#34 0x0000000010024ac4 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/chmeee/llvm_git/llvm/clang/tools/driver/cc1_main.cpp:240:15
#35 0x0000000010022964 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/home/chmeee/llvm_git/llvm/clang/tools/driver/driver.cpp:330:12
#36 0x00000008162535c4
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >*, bool*) const::$_1::operator()() const
/home/chmeee/llvm_git/llvm/clang/lib/Driver/Job.cpp:417:34                      
#37 0x00000008162535c4 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__1::basic_string<char
, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*)
const::$_1>(long)
/home/chmeee/llvm_git/llvm/llvm/include/llvm/ADT/STLExtras.h:108:12
#38 0x0000000817a37388 llvm::function_ref<void ()>::operator()() const
/home/chmeee/llvm_git/llvm/llvm/include/llvm/ADT/STLExtras.h:124:12
#39 0x0000000817a37388
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
/home/chmeee/llvm_git/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:418:3
#40 0x00000008162528ac
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >*, bool*) const
/home/chmeee/llvm_git/llvm/clang/lib/Driver/Job.cpp:417:12                      
#41 0x000000081622283c
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
/home/chmeee/llvm_git/llvm/clang/lib/Driver/Compilation.cpp:195:15
#42 0x0000000816222d54
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&)
const /home/chmeee/llvm_git/llvm/clang/lib/Driver/Compilation.cpp:246:19       
                                                                               
                               #43 0x0000000816238fa4
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&)
/home/chmeee/llvm_git/llvm/clang/lib/Driver/Driver.cpp:1473:5                  
                                                                       #44
0x0000000010021f5c main
/home/chmeee/llvm_git/llvm/clang/tools/driver/driver.cpp:502:21
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)                                                                    
                        clang version 11.0.0
(https://github.com/llvm/llvm-project.git
48571b6ce89a12a323c8632cea05afd0c91aeb32)                                       
Target: powerpcspe-unknown-freebsd                                              
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200406/a075cfcf/attachment-0001.html>


More information about the llvm-bugs mailing list