[PATCH] D20295: When looking for a spill slot in reg scavenger, find one that matches RC

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 08:26:47 PDT 2016


kparzysz added inline comments.

================
Comment at: lib/CodeGen/RegisterScavenging.cpp:438-443
@@ -413,4 +437,8 @@
     // Spill the scavenged register before I.
-    assert(Scavenged[SI].FrameIndex >= 0 &&
-           "Cannot scavenge register without an emergency spill slot!");
+    if (Scavenged[SI].FrameIndex < 0) {
+      Twine Msg = Twine("Error while trying to spill ") + TRI->getName(SReg) +
+           " from class " + TRI->getRegClassName(RC) +
+           ": Cannot scavenge register without an emergency spill slot!";
+      report_fatal_error(Msg);
+    }
     TII->storeRegToStackSlot(*MBB, I, SReg, true, Scavenged[SI].FrameIndex,
----------------
At the second thought---wouldn't it be better to keep the "unreachable"?  report_fatal_error does not print the call stack.


Repository:
  rL LLVM

http://reviews.llvm.org/D20295





More information about the llvm-commits mailing list