* [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization
@ 2013-05-08 20:42 Aurelien Jarno
2013-05-08 20:49 ` Aurelien Jarno
2013-05-09 13:03 ` Richard Henderson
0 siblings, 2 replies; 3+ messages in thread
From: Aurelien Jarno @ 2013-05-08 20:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, Aurelien Jarno, Richard Henderson
When setcond2 is rewritten into setcond, the state of the destination
temp should be reset, so that a copy of the previous value is not
used instead of the result.
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
tcg/optimize.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 1b6644c..b35868a 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1057,6 +1057,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
/* Simplify LT/GE comparisons vs zero to a single compare
vs the high word of the input. */
s->gen_opc_buf[op_index] = INDEX_op_setcond_i32;
+ reset_temp(args[0]);
gen_args[0] = args[0];
gen_args[1] = args[2];
gen_args[2] = args[4];
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization
2013-05-08 20:42 [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization Aurelien Jarno
@ 2013-05-08 20:49 ` Aurelien Jarno
2013-05-09 13:03 ` Richard Henderson
1 sibling, 0 replies; 3+ messages in thread
From: Aurelien Jarno @ 2013-05-08 20:49 UTC (permalink / raw)
To: qemu-devel, qemu-stable; +Cc: Michael Tokarev, Richard Henderson
On Wed, May 08, 2013 at 10:42:42PM +0200, Aurelien Jarno wrote:
> When setcond2 is rewritten into setcond, the state of the destination
> temp should be reset, so that a copy of the previous value is not
> used instead of the result.
>
> Reported-by: Michael Tokarev <mjt@tls.msk.ru>
> Cc: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
> tcg/optimize.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index 1b6644c..b35868a 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -1057,6 +1057,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
> /* Simplify LT/GE comparisons vs zero to a single compare
> vs the high word of the input. */
> s->gen_opc_buf[op_index] = INDEX_op_setcond_i32;
> + reset_temp(args[0]);
> gen_args[0] = args[0];
> gen_args[1] = args[2];
> gen_args[2] = args[4];
I have just noticed that the problem is there since release 1.3, even if
it appeared more clearly only with commit 7eb0cc85. All 64-bit targets
on 32-bit hosts are possibly affected.
Therefore it should be fixed in the next stable releases. Hence the Cc
to qemu-stable@nongnu.org.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization
2013-05-08 20:42 [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization Aurelien Jarno
2013-05-08 20:49 ` Aurelien Jarno
@ 2013-05-09 13:03 ` Richard Henderson
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2013-05-09 13:03 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Michael Tokarev, qemu-devel
On 2013-05-08 15:42, Aurelien Jarno wrote:
> When setcond2 is rewritten into setcond, the state of the destination
> temp should be reset, so that a copy of the previous value is not
> used instead of the result.
>
> Reported-by: Michael Tokarev <mjt@tls.msk.ru>
> Cc: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Richard Henderson <rth@twiddle.net>
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-09 13:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08 20:42 [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization Aurelien Jarno
2013-05-08 20:49 ` Aurelien Jarno
2013-05-09 13:03 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).