diff options
| -rw-r--r-- | Documentation/IR.md | 2 | ||||
| -rw-r--r-- | linearize.c | 4 | ||||
| -rw-r--r-- | liveness.c | 5 |
3 files changed, 4 insertions, 7 deletions
diff --git a/Documentation/IR.md b/Documentation/IR.md index 7bbeda8f..03fa3f80 100644 --- a/Documentation/IR.md +++ b/Documentation/IR.md @@ -39,7 +39,7 @@ Switch / multi-branch #### OP_COMPUTEDGOTO Computed goto / branch to register -- .target: target address (type is irrelevant, void*) +- .src: address to branch to (void*) - .multijmp_list: list of possible destination basic blocks ### Arithmetic binops diff --git a/linearize.c b/linearize.c index eaa8913b..58da7ceb 100644 --- a/linearize.c +++ b/linearize.c @@ -390,7 +390,7 @@ const char *show_instruction(struct instruction *insn) } case OP_COMPUTEDGOTO: { struct multijmp *jmp; - buf += sprintf(buf, "%s", show_pseudo(insn->target)); + buf += sprintf(buf, "%s", show_pseudo(insn->src)); FOR_EACH_PTR(insn->multijmp_list, jmp) { buf += sprintf(buf, ", .L%u", jmp->target->nr); } END_FOR_EACH_PTR(jmp); @@ -2100,7 +2100,7 @@ static pseudo_t linearize_statement(struct entrypoint *ep, struct statement *stm pseudo = linearize_expression(ep, expr); goto_ins = alloc_instruction(OP_COMPUTEDGOTO, 0); - use_pseudo(goto_ins, pseudo, &goto_ins->target); + use_pseudo(goto_ins, pseudo, &goto_ins->src); add_one_insn(ep, goto_ins); FOR_EACH_PTR(stmt->target_list, sym) { @@ -54,6 +54,7 @@ static void track_instruction_usage(struct basic_block *bb, struct instruction * switch (insn->opcode) { case OP_RET: + case OP_COMPUTEDGOTO: USES(src); break; @@ -62,10 +63,6 @@ static void track_instruction_usage(struct basic_block *bb, struct instruction * USES(cond); break; - case OP_COMPUTEDGOTO: - USES(target); - break; - /* Binary */ case OP_BINARY ... OP_BINARY_END: case OP_FPCMP ... OP_FPCMP_END: |
