diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-03-09 16:29:52 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-03-09 16:29:52 +0000 |
| commit | 562c1808791dcea9ce7f625ee28a21cc63bc8bc6 (patch) | |
| tree | 41f4ed2a0bbd243218169ff2244c1b808a1847ba /llvm/lib | |
| parent | 623bb75d357e9fce3922018e59902b8807764e5c (diff) | |
| download | bcm5719-llvm-562c1808791dcea9ce7f625ee28a21cc63bc8bc6.tar.gz bcm5719-llvm-562c1808791dcea9ce7f625ee28a21cc63bc8bc6.zip | |
Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis!
llvm-svn: 20531
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index c50758541ed..98508a8c14c 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -307,7 +307,9 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size, if (!isa<Argument>(O1) && isa<ConstantPointerNull>(V2)) return NoAlias; // Unique values don't alias null - if (isa<GlobalVariable>(O1) || isa<AllocationInst>(O1)) + if (isa<GlobalVariable>(O1) || + (isa<AllocationInst>(O1) && + !cast<AllocationInst>(O1)->isArrayAllocation())) if (cast<PointerType>(O1->getType())->getElementType()->isSized()) { // If the size of the other access is larger than the total size of the // global/alloca/malloc, it cannot be accessing the global (it's @@ -323,7 +325,9 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size, if (!isa<Argument>(O2) && isa<ConstantPointerNull>(V1)) return NoAlias; // Unique values don't alias null - if (isa<GlobalVariable>(O2) || isa<AllocationInst>(O2)) + if (isa<GlobalVariable>(O2) || + (isa<AllocationInst>(O2) && + !cast<AllocationInst>(O2)->isArrayAllocation())) if (cast<PointerType>(O2->getType())->getElementType()->isSized()) { // If the size of the other access is larger than the total size of the // global/alloca/malloc, it cannot be accessing the object (it's |

