llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

X86RegisterInfo::eliminateFrameIndex: -O0 assertion failure "`i < getNumOperands() && "getOperand() out of range!"'"

Open llvmbot opened this issue 14 years ago • 4 comments

Bugzilla Link 13780
Resolution FIXED
Resolved on Sep 07, 2012 02:49
Version trunk
OS Linux
Attachments testcase .ll
Reporter LLVM Bugzilla Contributor
CC @darkbuck

Extended Description

$ llc -O0 attrib41.ll llc: include/llvm/CodeGen/MachineInstr.h:269: llvm::MachineOperand& llvm::MachineInstr::getOperand(unsigned int): Assertion `i < getNumOperands() && "getOperand() out of range!"' failed. ... llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::bundle_iterator<llvm::MachineInstr, llvm::ilist_iteratorllvm::MachineInstr >, int, llvm::RegScavenger*) const + 672 9 llc 0x0000000000be7cdf llvm::PEI::replaceFrameIndices(llvm::MachineFunction&) + 847 10 llc 0x0000000000bebede llvm::PEI::runOnMachineFunction(llvm::MachineFunction&) + 270 11 llc 0x0000000000e9063f llvm::FPPassManager::runOnFunction(llvm::Function&) + 607 12 llc 0x0000000000e90693 llvm::FPPassManager::runOnModule(llvm::Module&) + 51 13 llc 0x0000000000e9036c llvm::MPPassManager::runOnModule(llvm::Module&) + 524 14 llc 0x0000000000e939cf llvm::PassManagerImpl::run(llvm::Module&) + 127 15 llc 0x0000000000544ac3 main + 3427 16 libc.so.6 0x00007f6f4571a76d __libc_start_main + 237 17 llc 0x000000000055174d Stack dump: 0. Program arguments: llc -O0 attrib41.ll

  1. Running pass 'Function Pass Manager' on module 'attrib41.ll'.
  2. Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@main' Aborted (core dumped)

llvmbot avatar Sep 06 '12 18:09 llvmbot

Yes, commit 163370 fixed it - thanks. You forgot to add a testcase though.

llvmbot avatar Sep 07 '12 09:09 llvmbot

committed in r163370. Duncan, please verify whether it works for you.

darkbuck avatar Sep 07 '12 07:09 darkbuck

I attached a temporary fix to this issue and asked Nadav for opinion. Basically, it's a trivial issue. Stack coloring need LIFETIME region info and emits them during code gen. But itself is only enabled in non-O0 mode. The patch is just stopping emitting LIFETIME region info in O0 mode.

darkbuck avatar Sep 07 '12 02:09 darkbuck

temporary fix

darkbuck avatar Sep 07 '12 02:09 darkbuck