projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90379ca
)
tcg-sparc: Fix setcond_i32 uninitialized value
author
Richard Henderson
<rth@twiddle.net>
Wed, 6 Aug 2014 19:09:56 +0000
(12:09 -0700)
committer
Richard Henderson
<rth@redhat.com>
Mon, 29 Sep 2014 18:55:27 +0000
(14:55 -0400)
We failed to swap c1 and c2 correctly for NE c2 == 0.
Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/sparc/tcg-target.c
patch
|
blob
|
history
diff --git
a/tcg/sparc/tcg-target.c
b/tcg/sparc/tcg-target.c
index
08ca482
..
3b232d6
100644
(file)
--- a/
tcg/sparc/tcg-target.c
+++ b/
tcg/sparc/tcg-target.c
@@
-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, c2
const = 0;
+ c1 = TCG_REG_G0, c2const = 0;
cond = (cond == TCG_COND_EQ ? TCG_COND_GEU : TCG_COND_LTU);
break;