[llvm-commits] [llvm] r91691 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Rafael Espindola rafael.espindola at gmail.com
Fri Dec 18 08:59:39 PST 2009


Author: rafael
Date: Fri Dec 18 10:59:39 2009
New Revision: 91691

URL: http://llvm.org/viewvc/llvm-project?rev=91691&view=rev
Log:
Fix libstdc++ build on ARM linux and part of PR5770.

MI was not being used but it was also not being deleted, so it was kept in the garbage list. The memory itself was freed once the function code gen was done.

Once in a while the codegen of another function would create an instruction on the same address. Adding it to the garbage group would work once, but when another pointer was added it would cause an assert as "Cache" was about to be pushed to Ts.

For a patch that make us detect problems like this earlier, take a look at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091214/092758.html

With that patch we assert as soon and the new instruction is added to the garbage set.


Modified:
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=91691&r1=91690&r2=91691&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Fri Dec 18 10:59:39 2009
@@ -3147,6 +3147,9 @@
   unsigned ptr = MI->getOperand(1).getReg();
   unsigned incr = MI->getOperand(2).getReg();
   DebugLoc dl = MI->getDebugLoc();
+
+  F->DeleteMachineInstr(MI);   // The instruction is gone now.
+
   bool isThumb2 = Subtarget->isThumb2();
   unsigned ldrOpc, strOpc;
   switch (Size) {





More information about the llvm-commits mailing list