From 054cc8ad045dfae488b9a3310c2929bd987ebe7a Mon Sep 17 00:00:00 2001 From: Andrew Lenharth Date: Wed, 7 Feb 2007 22:32:03 +0000 Subject: Fix miscompile of linux kernel (llvm 1.9) llvm-svn: 34015 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index f00be24..cc7d8b9 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(SrcTy)) SrcTy = TD->getIntPtrType(); - if (isa(MidTy)) MidTy = TD->getIntPtrType(); - if (isa(DstTy)) DstTy = TD->getIntPtrType(); + if (isa(SrcTy)) SrcTy = TD->getIntPtrType()->getSignedVersion(); + if (isa(MidTy)) MidTy = TD->getIntPtrType()->getSignedVersion(); + if (isa(DstTy)) DstTy = TD->getIntPtrType()->getSignedVersion(); // Allow free casting and conversion of sizes as long as the sign doesn't // change... -- cgit v1.1