cse_one_instruction() contains some code to be executed when an OP_PHI is eliminated. This code is roughly equivalent to what is done in kill_instruction() for OP_PHI but not complete since it doesn't recursively try to kill others instructions which are used only by this OP_PHI. Fix this and avoid duplicated code by replacing this code by a call to kill_instruction(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- cse.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cse.c b/cse.c index e8fbe344f..165b862af 100644 --- a/cse.c +++ b/cse.c @@ -252,15 +252,7 @@ static struct instruction * cse_one_instruction(struct instruction *insn, struct convert_instruction_target(insn, def->target); if (insn->opcode == OP_PHI) { - /* Remove the instruction from PHI users */ - pseudo_t phi; - FOR_EACH_PTR(insn->phi_list, phi) { - struct pseudo_user *pu; - FOR_EACH_PTR(phi->users, pu) { - if (pu->insn == insn) - DELETE_CURRENT_PTR(pu); - } END_FOR_EACH_PTR(pu); - } END_FOR_EACH_PTR(phi); + kill_instruction(insn); } insn->opcode = OP_NOP; -- 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