Skip to content
Snippets Groups Projects
Commit 321b6c05 authored by Richard Henderson's avatar Richard Henderson Committed by Richard Henderson
Browse files

tcg-sparc: Fix setcond_i32 uninitialized value


We failed to swap c1 and c2 correctly for NE c2 == 0.

Signed-off-by: default avatarRichard Henderson <rth@twiddle.net>
parent 90379ca8
No related branches found
No related tags found
No related merge requests found
......@@ -674,9 +674,12 @@ static void tcg_out_setcond_i32(TCGContext *s, TCGCond cond, TCGReg ret,
case TCG_COND_NE:
/* For equality, we can transform to inequality vs zero. */
if (c2 != 0) {
tcg_out_arithc(s, ret, c1, c2, c2const, ARITH_XOR);
tcg_out_arithc(s, TCG_REG_T1, c1, c2, c2const, ARITH_XOR);
c2 = TCG_REG_T1;
} else {
c2 = c1;
}
c1 = TCG_REG_G0, c2 = ret, c2const = 0;
c1 = TCG_REG_G0, c2const = 0;
cond = (cond == TCG_COND_EQ ? TCG_COND_GEU : TCG_COND_LTU);
break;
......
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