summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2007-02-07 22:32:03 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2007-02-07 22:32:03 +0000
commit054cc8ad045dfae488b9a3310c2929bd987ebe7a (patch)
tree7a263fe408874d232e45c1add43a8462c1857def
parentLinker should keep sections on globals. This should propagate to mainline if... (diff)
downloadllvm-project-release/1.9.x.tar.gz
llvm-project-release/1.9.x.tar.bz2
llvm-project-release/1.9.x.zip
Fix miscompile of linux kernel (llvm 1.9)release/1.9.x
llvm-svn: 34015
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index f00be24aad0d..cc7d8b9263ae 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -377,9 +377,9 @@ static bool isEliminableCastOfCast(const Type *SrcTy, const Type *MidTy,
// If we are casting between pointer and integer types, treat pointers as
// integers of the appropriate size for the code below.
- if (isa<PointerType>(SrcTy)) SrcTy = TD->getIntPtrType();
- if (isa<PointerType>(MidTy)) MidTy = TD->getIntPtrType();
- if (isa<PointerType>(DstTy)) DstTy = TD->getIntPtrType();
+ if (isa<PointerType>(SrcTy)) SrcTy = TD->getIntPtrType()->getSignedVersion();
+ if (isa<PointerType>(MidTy)) MidTy = TD->getIntPtrType()->getSignedVersion();
+ if (isa<PointerType>(DstTy)) DstTy = TD->getIntPtrType()->getSignedVersion();
// Allow free casting and conversion of sizes as long as the sign doesn't
// change...