mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
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:
parent
135bf42187
commit
895ace08e0
@ -103,6 +103,8 @@ static bool isObjectSmallerThan(const Value *V, uint64_t Size,
|
|||||||
const TargetData &TD) {
|
const TargetData &TD) {
|
||||||
const Type *AccessTy;
|
const Type *AccessTy;
|
||||||
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
|
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
|
||||||
|
if (!GV->hasDefinitiveInitializer())
|
||||||
|
return false;
|
||||||
AccessTy = GV->getType()->getElementType();
|
AccessTy = GV->getType()->getElementType();
|
||||||
} else if (const AllocaInst *AI = dyn_cast<AllocaInst>(V)) {
|
} else if (const AllocaInst *AI = dyn_cast<AllocaInst>(V)) {
|
||||||
if (!AI->isArrayAllocation())
|
if (!AI->isArrayAllocation())
|
||||||
|
@ -16,3 +16,25 @@ define i16 @test1(i32* %P) {
|
|||||||
; CHECK: ret i16 0
|
; CHECK: ret i16 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; Cannot know anything about the size of this global.
|
||||||
|
; rdar://8813415
|
||||||
|
@window = external global [0 x i8]
|
||||||
|
|
||||||
|
; CHECK: @test2
|
||||||
|
define i8 @test2(i32 %tmp79, i32 %w.2, i32 %indvar89) nounwind {
|
||||||
|
%tmp92 = add i32 %tmp79, %indvar89
|
||||||
|
%arrayidx412 = getelementptr [0 x i8]* @window, i32 0, i32 %tmp92
|
||||||
|
%tmp93 = add i32 %w.2, %indvar89
|
||||||
|
%arrayidx416 = getelementptr [0 x i8]* @window, i32 0, i32 %tmp93
|
||||||
|
|
||||||
|
%A = load i8* %arrayidx412, align 1
|
||||||
|
store i8 4, i8* %arrayidx416, align 1
|
||||||
|
|
||||||
|
%B = load i8* %arrayidx412, align 1
|
||||||
|
%C = sub i8 %A, %B
|
||||||
|
ret i8 %C
|
||||||
|
|
||||||
|
; CHECK: %B = load i8
|
||||||
|
; CHECK: ret i8 %C
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user