fix rdar://8813415 - a miscompilation of 164.gzip that loop-idiom

exposed.  It turns out to be a latent bug in basicaa, scary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122772 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2011-01-03 21:03:33 +00:00
parent 135bf42187
commit 895ace08e0
2 changed files with 24 additions and 0 deletions

View File

@ -103,6 +103,8 @@ static bool isObjectSmallerThan(const Value *V, uint64_t Size,
const TargetData &TD) {
const Type *AccessTy;
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
if (!GV->hasDefinitiveInitializer())
return false;
AccessTy = GV->getType()->getElementType();
} else if (const AllocaInst *AI = dyn_cast<AllocaInst>(V)) {
if (!AI->isArrayAllocation())