clear_phi() only replaces a phi-node's sources by VOID without adjusting the usage of these sources. As such it can't be used for cleaning things before removing an OP_PHI. Fix this by replacing calls to clear_phi() by calls to kill_instruction(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- simplify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simplify.c b/simplify.c index 17f1e2b61..ddd0aa9c5 100644 --- a/simplify.c +++ b/simplify.c @@ -110,7 +110,7 @@ static int if_convert_phi(struct instruction *insn) * the conditional branch too. */ insert_select(source, br, insn, p1, p2); - clear_phi(insn); + kill_instruction(insn); return REPEAT_CSE; } @@ -140,7 +140,7 @@ static int clean_up_phi(struct instruction *insn) if (same) { pseudo_t pseudo = last ? last->src1 : VOID; convert_instruction_target(insn, pseudo); - clear_phi(insn); + kill_instruction(insn); return REPEAT_CSE; } @@ -1142,7 +1142,7 @@ int simplify_instruction(struct instruction *insn) return simplify_cast(insn); case OP_PHI: if (dead_insn(insn, NULL, NULL, NULL)) { - clear_phi(insn); + kill_use_list(insn->phi_list); return REPEAT_CSE; } return clean_up_phi(insn); -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html