Bug fix for test/Regression/Other/2002-02-14-LevelRaiseBadAssert.ll
authorChris Lattner <sabre@nondot.org>
Thu, 14 Feb 2002 22:21:40 +0000 (22:21 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 14 Feb 2002 22:21:40 +0000 (22:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1767 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/ExprTypeConvert.cpp
lib/Transforms/TransformInternals.cpp

index 5975a21ff3d4a276f04a5013c1383b178c7122a8..d716bca76deaafe41497c44c8f2dddd6ef6d1ad3 100644 (file)
@@ -307,8 +307,7 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty,
       //
       std::vector<Value*> 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!
index 6b42d0c76676a701669cca1a63464b2858443e23..f773a1c473e2c887cd7a7e447d5d99974c4a6f07 100644 (file)
@@ -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