From ee17130837d9cef3e587d6dea7533903c277718c Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 20 Mar 2021 16:11:40 +0100 Subject: memops: we can kill addresses unconditionally In rewrite_load_instruction(), if the load instruction is converted into a phi-node, its address is then no more used and must be removed. However, this is only done when this address is not a symbol. This was explicitly done in the following commit because of the problem of removing an element from the usage list while walking this list: 602f6b6c0d41 ("Leave symbol pseudo usage intact when doing phi-node conversion.") But currently rewrite_load_instruction() is only used during memops simplification where the usage list is not walked. So, kill the address' usage unconditionally. Signed-off-by: Luc Van Oostenryck --- memops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/memops.c b/memops.c index 67f37f79..89d9eb2c 100644 --- a/memops.c +++ b/memops.c @@ -45,9 +45,7 @@ static void rewrite_load_instruction(struct instruction *insn, struct pseudo_lis goto end; complex_phi: - /* We leave symbol pseudos with a bogus usage list here */ - if (insn->src->type != PSEUDO_SYM) - kill_use(&insn->src); + kill_use(&insn->src); insn->opcode = OP_PHI; insn->phi_list = dominators; -- cgit 1.2.3-korg