mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-05 14:34:55 +00:00
Fix infinite loop in DSE when deleting a free in a reachable loop that's also
trivially infinite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e955726a0e
commit
c9b98ad7a7
@ -624,6 +624,7 @@ static void FindUnconditionalPreds(SmallVectorImpl<BasicBlock *> &Blocks,
|
||||
BasicBlock *BB, DominatorTree *DT) {
|
||||
for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I) {
|
||||
BasicBlock *Pred = *I;
|
||||
if (Pred == BB) continue;
|
||||
TerminatorInst *PredTI = Pred->getTerminator();
|
||||
if (PredTI->getNumSuccessors() != 1)
|
||||
continue;
|
||||
@ -853,4 +854,3 @@ void DSE::RemoveAccessedObjects(const AliasAnalysis::Location &LoadedLoc,
|
||||
I != E; ++I)
|
||||
DeadStackObjects.erase(*I);
|
||||
}
|
||||
|
||||
|
@ -58,3 +58,13 @@ skipinit1:
|
||||
tail call void @free(i8* %alloc1) nounwind
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: @test5
|
||||
define void @test5() {
|
||||
br label %bb
|
||||
|
||||
bb:
|
||||
tail call void @free(i8* undef) nounwind
|
||||
br label %bb
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user