From: Petar Jovanovic Date: Mon, 22 May 2017 15:14:06 +0000 (+0000) Subject: mips: fix set_MIPS_rounding_mode() X-Git-Tag: svn/VALGRIND_3_13_0^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0781a61cfec94d1280707673a04fc70e79502e3;p=thirdparty%2Fvalgrind.git mips: fix set_MIPS_rounding_mode() Do not override input argument. This fixes issues seen with CSE. Patch by Tamara Vlahovic. git-svn-id: svn://svn.valgrind.org/vex/trunk@3381 --- diff --git a/VEX/priv/host_mips_isel.c b/VEX/priv/host_mips_isel.c index c06953a765..580865b455 100644 --- a/VEX/priv/host_mips_isel.c +++ b/VEX/priv/host_mips_isel.c @@ -284,7 +284,7 @@ static void set_MIPS_rounding_mode(ISelEnv * env, IRExpr * mode) addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, tmp, irrm, MIPSRH_Imm(False, 1))); addInstr(env, MIPSInstr_Alu(Malu_XOR, tmp, irrm, MIPSRH_Reg(tmp))); - addInstr(env, MIPSInstr_Alu(Malu_AND, irrm, tmp, MIPSRH_Imm(False, 3))); + addInstr(env, MIPSInstr_Alu(Malu_AND, tmp, tmp, MIPSRH_Imm(False, 3))); /* save old value of FCSR */ addInstr(env, MIPSInstr_MfFCSR(fcsr_old)); sub_from_sp(env, 8); /* Move SP down 8 bytes */ @@ -294,7 +294,7 @@ static void set_MIPS_rounding_mode(ISelEnv * env, IRExpr * mode) addInstr(env, MIPSInstr_Store(4, am_addr, fcsr_old, mode64)); /* set new value of FCSR */ - addInstr(env, MIPSInstr_MtFCSR(irrm)); + addInstr(env, MIPSInstr_MtFCSR(tmp)); } static void set_MIPS_rounding_default(ISelEnv * env)