summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-03-30 21:37:19 +0000
committerBill Wendling <isanbard@gmail.com>2011-03-30 21:37:19 +0000
commit5034159c5ff5da6b455f779b3b56e6cbf89a59d4 (patch)
treeaaa24f0cdfdc8e496ae9675602778b999bd9ae07 /llvm/lib/Transforms
parentc640179166b973c6969d450ccb59b3c8bf5a5133 (diff)
downloadbcm5719-llvm-5034159c5ff5da6b455f779b3b56e6cbf89a59d4.tar.gz
bcm5719-llvm-5034159c5ff5da6b455f779b3b56e6cbf89a59d4.zip
* The DSE code that tested for overlapping needed to take into account the fact
that one of the numbers is signed while the other is unsigned. This could lead to a wrong result when the signed was promoted to an unsigned int. * Add the data layout line to the testcase so that it will test the appropriate thing. Patch by David Terei! llvm-svn: 128577
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index f473cf5ca54..9f36a386917 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -361,8 +361,10 @@ static bool isCompleteOverwrite(const AliasAnalysis::Location &Later,
//
// |--earlier--|
// |----- later ------|
+ //
+ // We have to be careful here as *Off is signed while *.Size is unsigned.
if (EarlierOff >= LaterOff &&
- EarlierOff + Earlier.Size <= LaterOff + Later.Size)
+ uint64_t(EarlierOff - LaterOff) + Earlier.Size <= Later.Size)
return true;
// Otherwise, they don't completely overlap.
OpenPOWER on IntegriCloud