[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLocal.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jun 16 02:04:02 PDT 2004


Changes in directory llvm/lib/CodeGen:

RegAllocLocal.cpp updated: 1.62 -> 1.63

---
Log message:

Fix a recent regression in Applications/sgefa that Alkis pointed out to me.
The vector may actually be empty if the register that we are marking as
recently used is not actually allocatable.  This happens for physical registers
that are not allocatable, like the ST(x) registers on X86.


---
Diffs of the changes:  (+2 -2)

Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.62 llvm/lib/CodeGen/RegAllocLocal.cpp:1.63
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.62	Wed Jun  2 00:57:12 2004
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Wed Jun 16 01:57:29 2004
@@ -93,8 +93,8 @@
     }
 
     void MarkPhysRegRecentlyUsed(unsigned Reg) {
-      assert(!PhysRegsUseOrder.empty() && "No registers used!");
-      if (PhysRegsUseOrder.back() == Reg) return;  // Already most recently used
+      if(PhysRegsUseOrder.empty() ||
+         PhysRegsUseOrder.back() == Reg) return;  // Already most recently used
 
       for (unsigned i = PhysRegsUseOrder.size(); i != 0; --i)
         if (areRegsEqual(Reg, PhysRegsUseOrder[i-1])) {





More information about the llvm-commits mailing list