From 868c2d3c05d9a74608448056d049f1bddd9e6219 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 14 Feb 2002 22:21:40 +0000 Subject: [PATCH] Bug fix for test/Regression/Other/2002-02-14-LevelRaiseBadAssert.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1767 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/ExprTypeConvert.cpp | 3 +-- lib/Transforms/TransformInternals.cpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp index 5975a21ff3d..d716bca76de 100644 --- a/lib/Transforms/ExprTypeConvert.cpp +++ b/lib/Transforms/ExprTypeConvert.cpp @@ -307,8 +307,7 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty, // std::vector Indices; const Type *ElTy = ConvertableToGEP(PTy, I->getOperand(1), Indices); - if (ElTy) { - assert(ElTy == PVTy && "Internal error, setup wrong!"); + if (ElTy == PVTy) { if (!ExpressionConvertableToType(I->getOperand(0), PointerType::get(ElTy), CTMap)) return false; // Can't continue, ExConToTy might have polluted set! diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp index 6b42d0c7667..f773a1c473e 100644 --- a/lib/Transforms/TransformInternals.cpp +++ b/lib/Transforms/TransformInternals.cpp @@ -155,6 +155,7 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal, int Val = getConstantValue(Expr.Scale); if (Val < 0) return false; // Don't mess with negative scales Scale = (unsigned)Val; + if (Scale == 1) Scale = 0; // No interesting scale if *1 } // Loop over the Scale and Offset values, filling in the Indices vector for -- 2.34.1