@@ -148,6 +148,17 @@ static void kill_store(struct instruction *insn)
}
}
+static void kill_pseudo_stores(pseudo_t pseudo)
+{
+ struct pseudo_user *pu;
+
+ FOR_EACH_PTR(pseudo->users, pu) {
+ struct instruction *insn = pu->insn;
+ if (insn->opcode == OP_STORE)
+ kill_store(insn);
+ } END_FOR_EACH_PTR(pu);
+}
+
/* Kill a pseudo that is dead on exit from the bb */
static void kill_dead_stores(pseudo_t pseudo, unsigned long generation, struct basic_block *bb, int local)
{
@@ -307,11 +318,7 @@ static void promote_symbol(struct entrypoint *ep, struct symbol *sym)
/* If we converted all the loads, remove the stores. They are dead */
if (all && !mod) {
- FOR_EACH_PTR(pseudo->users, pu) {
- struct instruction *insn = pu->insn;
- if (insn->opcode == OP_STORE)
- kill_store(insn);
- } END_FOR_EACH_PTR(pu);
+ return kill_pseudo_stores(pseudo);
} else {
/*
* If we couldn't take the shortcut, see if we can at least kill some