Skip to content

Commit 0dfae4f

Browse files
committed
target/sparc: Fix RETURN
Perform window restore before pc update. Required in order to recognize any window underflow trap with the current pc. Fixes: 86b82fe ("target/sparc: Move JMPL, RETT, RETURN to decodetree") Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
1 parent e2faabe commit 0dfae4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

target/sparc/translate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4096,12 +4096,12 @@ TRANS(RETT, 32, do_add_special, a, do_rett)
40964096
static bool do_return(DisasContext *dc, int rd, TCGv src)
40974097
{
40984098
gen_check_align(dc, src, 3);
4099+
gen_helper_restore(tcg_env);
40994100

41004101
gen_mov_pc_npc(dc);
41014102
tcg_gen_mov_tl(cpu_npc, src);
41024103
gen_address_mask(dc, cpu_npc);
41034104

4104-
gen_helper_restore(tcg_env);
41054105
dc->npc = DYNAMIC_PC_LOOKUP;
41064106
return true;
41074107
}

0 commit comments

Comments
 (0)