[llvm] r270220 - Correction to r270219: fix detection of invalid frame index

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 07:34:04 PDT 2016


Author: kparzysz
Date: Fri May 20 09:34:03 2016
New Revision: 270220

URL: http://llvm.org/viewvc/llvm-project?rev=270220&view=rev
Log:
Correction to r270219: fix detection of invalid frame index

Modified:
    llvm/trunk/lib/CodeGen/RegisterScavenging.cpp

Modified: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterScavenging.cpp?rev=270220&r1=270219&r2=270220&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterScavenging.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Fri May 20 09:34:03 2016
@@ -438,7 +438,8 @@ unsigned RegScavenger::scavengeRegister(
   // otherwise, use the emergency stack spill slot.
   if (!TRI->saveScavengerRegister(*MBB, I, UseMI, RC, SReg)) {
     // Spill the scavenged register before I.
-    if (Scavenged[SI].FrameIndex < 0) {
+    int FI = Scavenged[SI].FrameIndex;
+    if (FI < FIB || FI >= FIE) {
       Twine Msg = Twine("Error while trying to spill ") + TRI->getName(SReg) +
            " from class " + TRI->getRegClassName(RC) +
            ": Cannot scavenge register without an emergency spill slot!";




More information about the llvm-commits mailing list