[llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp

Dale Johannesen dalej at apple.com
Mon Apr 2 13:31:24 PDT 2007



Changes in directory llvm/lib/Target/ARM:

ARMConstantIslandPass.cpp updated: 1.33 -> 1.34
---
Log message:

fix off by 1 error in displacement computation


---
Diffs of the changes:  (+5 -0)

 ARMConstantIslandPass.cpp |    5 +++++
 1 files changed, 5 insertions(+)


Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.33 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.34
--- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.33	Thu Mar  1 02:26:31 2007
+++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp	Mon Apr  2 15:31:06 2007
@@ -593,6 +593,11 @@
        Water->begin()->getOpcode() != ARM::CONSTPOOL_ENTRY))
     CPEOffset += 2;
 
+  // If the CPE is to be inserted before the instruction, that will raise
+  // the offset of the instruction.
+  if (CPEOffset < UserOffset)
+    UserOffset += isThumb ? 2 : 4;
+
   return OffsetIsInRange (UserOffset, CPEOffset, MaxDisp, !isThumb);
 }
 






More information about the llvm-commits mailing list