aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-13 20:17:42 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-17 18:03:24 +0100
commit09474b0a451bd4e3baea5e1a5e04f9b28f644bb3 (patch)
tree70b77d62b9a625e04398903dc1db51e7fa793a8e /simplify.c
parent5a7a06698fe2cd4ccb8d3f1a8585c70e6d8f7531 (diff)
downloadsparse-dev-09474b0a451bd4e3baea5e1a5e04f9b28f644bb3.tar.gz
cfg: add missing REPEAT_CFG_CLEANUP
simplify_branch() & insert_branch() convert a conditional branch into an unconditional one, removing a child which may then become unreachable. However, these function doesn't set REPEAT_CFG_CLEANUP and the unreachable child may not be removed. Fix this by setting the missing REPEAT_CFG_CLEANUP in these functions. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/simplify.c b/simplify.c
index e58fb6cf..a0e23d6d 100644
--- a/simplify.c
+++ b/simplify.c
@@ -2048,7 +2048,7 @@ static int simplify_branch(struct instruction *insn)
kill_use(&insn->cond);
insn->cond = NULL;
insn->opcode = OP_BR;
- return REPEAT_CSE;
+ return REPEAT_CSE|REPEAT_CFG_CLEANUP;
}
/* Conditional on a SETNE $0 or SETEQ $0 */