Skip to content
Snippets Groups Projects
Commit 724eaece authored by Tomoaki Kawada's avatar Tomoaki Kawada Committed by Richard Henderson
Browse files

target/rx: update PC correctly in wait instruction


`cpu_pc` at this point does not necessary point to the current
instruction (i.e., the wait instruction being translated), so it's
incorrect to calculate the new value of `cpu_pc` based on this. It must
be updated with `ctx->base.pc_next`, which contains the correct address
of the next instruction.

This change fixes the wait instruction skipping the subsequent branch
when used in an idle loop like this:

    0:  wait
        bra.b 0b
        brk   // should be unreachable

Signed-off-by: default avatarTomoaki Kawada <i@yvt.jp>
Reviewed-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417060224.2131788-1-i@yvt.jp>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 335cd065
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment