aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorJiang Biao <jiang.biao2@zte.com.cn>2017-07-10 14:59:39 +0800
committerRichard Henderson <rth@twiddle.net>2017-07-09 21:11:38 -1000
commit8b8d768f19037a825a0bc81654492caa7c8fab8b (patch)
treea6fbbe642e02e3181e7b1a41782ceb3f2d3299fd /tcg
parent2ae96c157ab3155baf6595c08cf5d3fe3c023a60 (diff)
tcg/mips: Bugfix for crash when running program with qemu-i386.
When running a helloworld program with qemu-i386 in linux-user mode on Loongson 3A3000, it will crash. This patch fix the bug. Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn> Message-Id: <1499669979-25904-1-git-send-email-jiang.biao2@zte.com.cn> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/mips/tcg-target.inc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c
index 8cff9a6bf9..85756b81d5 100644
--- a/tcg/mips/tcg-target.inc.c
+++ b/tcg/mips/tcg-target.inc.c
@@ -1547,8 +1547,8 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64)
} else if (guest_base == (int16_t)guest_base) {
tcg_out_opc_imm(s, ALIAS_PADDI, base, addr_regl, guest_base);
} else {
- tcg_out_movi(s, TCG_TYPE_PTR, base, guest_base);
- tcg_out_opc_reg(s, ALIAS_PADD, base, base, addr_regl);
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, guest_base);
+ tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP0, addr_regl);
}
tcg_out_qemu_ld_direct(s, data_regl, data_regh, base, opc, is_64);
#endif
@@ -1652,8 +1652,8 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
} else if (guest_base == (int16_t)guest_base) {
tcg_out_opc_imm(s, ALIAS_PADDI, base, addr_regl, guest_base);
} else {
- tcg_out_movi(s, TCG_TYPE_PTR, base, guest_base);
- tcg_out_opc_reg(s, ALIAS_PADD, base, base, addr_regl);
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, guest_base);
+ tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP0, addr_regl);
}
tcg_out_qemu_st_direct(s, data_regl, data_regh, base, opc);
#endif