summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-03-14 05:12:19 +0000
committerBill Wendling <isanbard@gmail.com>2008-03-14 05:12:19 +0000
commit68a930b33e540d3ab19ec58a03f44840b08a2349 (patch)
tree41355b2b7ae89f2f79c39da173fd461708999267 /llvm/lib/Transforms
parent3108798ecbb2d6d07bdaf1f2b604b0cbe30c4094 (diff)
downloadbcm5719-llvm-68a930b33e540d3ab19ec58a03f44840b08a2349.tar.gz
bcm5719-llvm-68a930b33e540d3ab19ec58a03f44840b08a2349.zip
The inst combining of inttoptr into GEP with one index was using the bit size of
the type instead of the byte size. This was causing troublesome mis-compilations. True to form, this took 2 days to find and is a one-line fix. :-P llvm-svn: 48354
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index ec51508e657..9b423a40db1 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7416,7 +7416,7 @@ Instruction *InstCombiner::visitIntToPtr(IntToPtrInst &CI) {
// is a single-index GEP.
if (X->getType() == CI.getType()) {
// Get the size of the pointee type.
- uint64_t Size = TD->getABITypeSizeInBits(DestPointee);
+ uint64_t Size = TD->getABITypeSize(DestPointee);
// Convert the constant to intptr type.
APInt Offset = Cst->getValue();
OpenPOWER on IntegriCloud