diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-28 13:03:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:05:10 -0700 |
commit | cd181886e7fe7896d16f54368ec64ca633b23d99 (patch) | |
tree | ce86ef9e580d7d59bd0cc0ef4346971473ec089d /flow.c | |
parent | Clean up bb merging a bit. Still chasing "the bug". (diff) | |
download | sparse-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |