llvm / llvm-project

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

Another regscavenger assertion #5088

Closed asl closed 15 years ago

asl commented 15 years ago
Bugzilla Link 4716
Resolution FIXED
Resolved on Aug 15, 2009 08:21
Version trunk
OS All
Attachments regscav.ll
CC @stoklund

Extended Description

Consider the attached testcase. It currently causes the following assertion:

Assertion failed: ((KillRegs.test(Reg) || isUnused(Reg) || isLiveInButUnusedBefore(Reg, MI, MBB, TRI, MRI)) && "Re-defining a live register!"), function forward, file /Users/asl/Projects/llvm/src/lib/CodeGen/RegisterScavenging.cpp, line 245. 0 llc 0x00adf040 llvm::sys::SetInterruptFunction(void ()()) + 82 1 llc 0x00adf42f llvm::sys::SetInterruptFunction(void ()()) + 1089 2 libSystem.B.dylib 0x9329c2bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1825979759 4 libSystem.B.dylib 0x9331023a raise + 26 5 libSystem.B.dylib 0x9331c679 abort + 73 6 libSystem.B.dylib 0x933113db __assert_rtn + 101 7 llc 0x0088f03c llvm::RegScavenger::forward() + 1418 8 llc 0x0037f94d llvm::RegScavenger::forward(llvm::ilist_iterator) + 107 9 llc 0x008558dd llvm::PEI::replaceFrameIndices(llvm::MachineFunction&) + 1221 10 llc 0x00857881 llvm::PEI::runOnMachineFunction(llvm::MachineFunction&) + 407 11 llc 0x00823f8f llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 77 12 llc 0x00a56db8 llvm::FPPassManager::runOnFunction(llvm::Function&) + 304 13 llc 0x00a57028 llvm::FunctionPassManagerImpl::run(llvm::Function&) + 112 14 llc 0x00a5713c llvm::FunctionPassManager::run(llvm::Function&) + 130 15 llc 0x000038ba main + 3664 16 llc 0x00002436 start + 54 17 llc 0x00000003 start + 18446744073709542403 Stack dump:

  1. Program arguments: ./llc regscav4.bc -debug
  2. Running pass 'Prolog/Epilog Insertion & Frame Finalization' on function '@_start'

I believe that this testcase worked fine ~month ago, so this should be some fallout from recent changes

1ba3d143-a64b-4671-82b2-0b31cfb91709 commented 15 years ago

Fixed here: http://llvm.org/viewvc/llvm-project?rev=79096&view=rev

1ba3d143-a64b-4671-82b2-0b31cfb91709 commented 15 years ago

The tail call is turned into a BL which clobbers %LR in the naked function. That is what the scavenger is complaining about.

I will research some more.