Handle an interesting corner case: the constpool_entry being reference is two
authorEvan Cheng <evan.cheng@apple.com>
Wed, 31 Jan 2007 23:35:18 +0000 (23:35 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 31 Jan 2007 23:35:18 +0000 (23:35 +0000)
instructions away, i.e. its address is equal to PC.
        %r0 = tLDRpci <cp#0>
        bx
        CONSTPOOL_ENTRY 0 <cp#0>, 4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33728 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMConstantIslandPass.cpp

index 132ec8030fd81ef58598962bbe6db33df30877ae..93115288b92b642520f5f6de08882b2cb53a372e 100644 (file)
@@ -472,7 +472,7 @@ bool ARMConstantIslands::CPEIsInRange(MachineInstr *MI, MachineInstr *CPEMI,
                   << " at offset " << int(UserOffset-CPEOffset) << "\t"
                   << *MI);
 
-  if (UserOffset < CPEOffset) {
+  if (UserOffset <= CPEOffset) {
     // User before the CPE.
     if (CPEOffset-UserOffset <= MaxDisp)
       return true;
@@ -563,7 +563,7 @@ bool ARMConstantIslands::BBIsInRange(MachineInstr *MI,MachineBasicBlock *DestBB,
                   << " at offset " << int(BrOffset-DestOffset) << "\t"
                   << *MI);
 
-  if (BrOffset < DestOffset) {
+  if (BrOffset <= DestOffset) {
     if (DestOffset - BrOffset < MaxDisp)
       return true;
   } else {