aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 6c632c2aee..1fe2962a36 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -672,7 +672,10 @@ static bool CorrectExtraCFGEdges(MachineBasicBlock &MBB,
MachineBasicBlock::pred_iterator SI = MBB.succ_begin();
while (SI != MBB.succ_end()) {
- if (*SI == DestA) {
+ if (*SI == DestA && DestA == DestB) {
+ DestA = DestB = 0;
+ ++SI;
+ } else if (*SI == DestA) {
DestA = 0;
++SI;
} else if (*SI == DestB) {