aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-11 18:53:02 +0000
committerDan Gohman <gohman@apple.com>2008-09-11 18:53:02 +0000
commit2c3b489e6e9435c9e9e88fd6a168af6fec84f746 (patch)
tree0513d3c386e134595147273c5d895b5b02417409 /lib
parentc5d589ffa6efaf4188aedcb9745cb5a09f5c4d3e (diff)
downloadexternal_llvm-2c3b489e6e9435c9e9e88fd6a168af6fec84f746.zip
external_llvm-2c3b489e6e9435c9e9e88fd6a168af6fec84f746.tar.gz
external_llvm-2c3b489e6e9435c9e9e88fd6a168af6fec84f746.tar.bz2
Fix a copy+paste bug that Duncan spotted. For several
cases it was still getting lucky and detecting overflow but it was clearly incorrect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 46ac762..5a9d1de 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4699,7 +4699,7 @@ static bool AddWithOverflow(ConstantInt *&Result, ConstantInt *In1,
/// overflowed for this type.
static bool SubWithOverflow(ConstantInt *&Result, ConstantInt *In1,
ConstantInt *In2, bool IsSigned = false) {
- Result = cast<ConstantInt>(Add(In1, In2));
+ Result = cast<ConstantInt>(Subtract(In1, In2));
if (IsSigned)
if (In2->getValue().isNegative())