aboutsummaryrefslogtreecommitdiff
path: root/flow.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-28 13:03:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:10 -0700
commitcd181886e7fe7896d16f54368ec64ca633b23d99 (patch)
treece86ef9e580d7d59bd0cc0ef4346971473ec089d /flow.c
parentClean up bb merging a bit. Still chasing "the bug". (diff)
downloadsparse-cd181886e7fe7896d16f54368ec64ca633b23d99.tar.gz
sparse-cd181886e7fe7896d16f54368ec64ca633b23d99.tar.bz2
sparse-cd181886e7fe7896d16f54368ec64ca633b23d99.zip
When turning a conditional branch into an unconditional one,
remember to remove one parent.. Let's make sure that the flow information always matches the instruction.
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/flow.c b/flow.c
index 45efa3b..ca2d63a 100644
--- a/flow.c
+++ b/flow.c
@@ -671,8 +671,12 @@ static int rewrite_parent_branch(struct basic_block *bb, struct basic_block *old
case OP_BR:
rewrite_branch(bb, &insn->bb_true, old, new);
rewrite_branch(bb, &insn->bb_false, old, new);
- if (insn->bb_true == insn->bb_false)
+
+ /* Conditional branch to same target? */
+ if (insn->bb_true == insn->bb_false) {
+ remove_bb_from_list(&new->parents, bb, 1);
insn->bb_false = NULL;
+ }
return 1;
case OP_SWITCH: {
struct multijmp *jmp;