aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-11 20:41:36 +0000
committerChris Lattner <sabre@nondot.org>2009-01-11 20:41:36 +0000
commit0bd6f2b5cb1e8f0a3e2d8ff4f36baf598558096e (patch)
tree491374c9033a72e7f90e1f626d5c81fb26418fbd /lib/Transforms/Scalar/InstructionCombining.cpp
parentd35ce6ac5bdf4747c583a80d488d81b74e506622 (diff)
downloadexternal_llvm-0bd6f2b5cb1e8f0a3e2d8ff4f36baf598558096e.zip
external_llvm-0bd6f2b5cb1e8f0a3e2d8ff4f36baf598558096e.tar.gz
external_llvm-0bd6f2b5cb1e8f0a3e2d8ff4f36baf598558096e.tar.bz2
Duncan is nervous about undefinedness of % with negatives. I'm
not thrilled about 64-bit % in general, so rewrite to use * instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-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 b6604a9..4921531 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7710,7 +7710,7 @@ static bool FindElementAtOffset(const Type *Ty, int64_t Offset,
int64_t FirstIdx = 0;
if (int64_t TySize = TD->getABITypeSize(Ty)) {
FirstIdx = Offset/TySize;
- Offset %= TySize;
+ Offset -= FirstIdx*TySize;
// Handle hosts where % returns negative instead of values [0..TySize).
if (Offset < 0) {