@@ -2101,6 +2101,7 @@ static void add_asm_output(struct entrypoint *ep, struct instruction *insn, stru
linearize_store_gen(ep, pseudo, &ad);
}
rule = __alloc_asm_constraint(0);
+ rule->is_memory = op->is_memory;
rule->ident = op->name;
rule->constraint = op->constraint ? op->constraint->string->data : "";
use_pseudo(insn, pseudo, &rule->pseudo);
@@ -68,6 +68,7 @@ struct asm_constraint {
pseudo_t pseudo;
const char *constraint;
const struct ident *ident;
+ unsigned int is_memory:1;
};
DECLARE_ALLOCATOR(asm_constraint);
@@ -39,7 +39,10 @@ static void asm_liveness(struct basic_block *bb, struct instruction *insn,
} END_FOR_EACH_PTR(entry);
FOR_EACH_PTR(insn->asm_rules->outputs, entry) {
- def(bb, entry->pseudo);
+ if (entry->is_memory)
+ use(bb, entry->pseudo);
+ else
+ def(bb, entry->pseudo);
} END_FOR_EACH_PTR(entry);
}
Since memory operands are only some kind of reference, the pseudo in an output operand is not defined by the statement, the reference is only used. Fix the liveness processing accordingly. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- linearize.c | 1 + linearize.h | 1 + liveness.c | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-)