[AArch64] Avoid hitting the assert in RegScavenger::scavengeRegister

Sanjin Sijaric ssijaric at codeaurora.org
Thu Feb 13 02:58:17 PST 2014


Hi,

 

The attached patch is to account for the total size of arguments passed in
the caller's stack frame when determining whether to create an emergency
spill slot for register scavenging.  It may be the case that the stack size
estimate falls just within the allowed displacement, so that no emergency
spill slot is created.  In the case where we need an additional register to
compute the offset when trying to access arguments passed in the caller's
stack frame, we will hit the following assert in
RegScaveneger::scavengeRegister(.) if we cannot scavenge a spare register
without spilling:

 

assert(Scavenged[SI].FrameIndex >= 0 &&

           "Cannot scavenge register without an emergency spill slot!");

 

I didn't attach a test case as this was triggered by an internal test, and
coming up with these exact conditions was proving to be a little tricky.

 

Thanks,

Sanjin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140213/66bb5708/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scavenge.patch
Type: application/octet-stream
Size: 1718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140213/66bb5708/attachment.obj>


More information about the llvm-commits mailing list