summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-11-20 19:37:38 +0000
committerJim Grosbach <grosbach@apple.com>2009-11-20 19:37:38 +0000
commit6c3b71195a6221b80ceab19cec2fee3814ba893a (patch)
tree25ce3b04e9dd23982c285c373bb35e28150b44a8
parentff203777407a26b09682b6a21b77c2a73a4f1d65 (diff)
downloadbcm5719-llvm-6c3b71195a6221b80ceab19cec2fee3814ba893a.tar.gz
bcm5719-llvm-6c3b71195a6221b80ceab19cec2fee3814ba893a.zip
The verify() call of CPEIsInRange() isn't right for the assertion check of
constant pool ranges, as CPEIsInRange() makes conservative assumptions about the potential alignment changes from branch adjustments. The verification, on the other hand, runs after those branch adjustments are made, so the effects on alignment are known and already taken into account. The sanity check in verify should check the range directly instead. llvm-svn: 89473
-rw-r--r--llvm/lib/Target/ARM/ARMConstantIslandPass.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index 1832909a29b..e59a315a483 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -244,12 +244,15 @@ void ARMConstantIslands::verify(MachineFunction &MF) {
(BBOffsets[MBBId]%4 != 0 && BBSizes[MBBId]%4 != 0));
}
}
-#endif
for (unsigned i = 0, e = CPUsers.size(); i != e; ++i) {
CPUser &U = CPUsers[i];
unsigned UserOffset = GetOffsetOf(U.MI) + (isThumb ? 4 : 8);
- assert (CPEIsInRange(U.MI, UserOffset, U.CPEMI, U.MaxDisp, U.NegOk, true));
+ unsigned CPEOffset = GetOffsetOf(U.CPEMI);
+ unsigned Disp = UserOffset < CPEOffset ? CPEOffset - UserOffset :
+ UserOffset - CPEOffset;
+ assert(Disp <= U.MaxDisp || "Constant pool entry out of range!");
}
+#endif
}
/// print block size and offset information - debugging
OpenPOWER on IntegriCloud