From 2ed4beefeac81d047e3fb6bed1db45c98ee40915 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 21 Mar 2002 23:02:37 +0000 Subject: [PATCH] Fix bug test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise3.ll llvm-svn: 1943 --- lib/Transforms/ExprTypeConvert.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp index 3c3e27161b4..cd76bdbf1f3 100644 --- a/lib/Transforms/ExprTypeConvert.cpp +++ b/lib/Transforms/ExprTypeConvert.cpp @@ -71,7 +71,7 @@ static bool MallocConvertableToType(MallocInst *MI, const Type *Ty, unsigned OldTypeSize = TD.getTypeSize(MI->getType()->getElementType()); // Must have a scale or offset to analyze it... - if (!Expr.Offset && !Expr.Scale) return false; + if (!Expr.Offset && !Expr.Scale && OldTypeSize == 1) return false; // Get the offset and scale of the allocation... int OffsetVal = Expr.Offset ? getConstantValue(Expr.Offset) : 0;