Skip to content

Commit

Permalink
tcg: properly check that op's output needs to be synced to memory
Browse files Browse the repository at this point in the history
Fix typo introduced in b3a1be8.

Reported-by: Ruslan Savchenko <ruslan.savchenko@gmail.com>
Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
  • Loading branch information
batuzovk authored and aurel32 committed Nov 11, 2012
1 parent 7c2c3ea commit 3c5645f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tcg/tcg.c
Expand Up @@ -1337,8 +1337,8 @@ static void tcg_liveness_analysis(TCGContext *s)
the low part. The result can be optimized to a simple
add or sub. This happens often for x86_64 guest when the
cpu mode is set to 32 bit. */
if (dead_temps[args[1]] && !mem_temps[1]) {
if (dead_temps[args[0]] && !mem_temps[0]) {
if (dead_temps[args[1]] && !mem_temps[args[1]]) {
if (dead_temps[args[0]] && !mem_temps[args[0]]) {
goto do_remove;
}
/* Create the single operation plus nop. */
Expand All @@ -1363,8 +1363,8 @@ static void tcg_liveness_analysis(TCGContext *s)
nb_iargs = 2;
nb_oargs = 2;
/* Likewise, test for the high part of the operation dead. */
if (dead_temps[args[1]] && !mem_temps[1]) {
if (dead_temps[args[0]] && !mem_temps[0]) {
if (dead_temps[args[1]] && !mem_temps[args[1]]) {
if (dead_temps[args[0]] && !mem_temps[args[0]]) {
goto do_remove;
}
gen_opc_buf[op_index] = op = INDEX_op_mul_i32;
Expand Down

0 comments on commit 3c5645f

Please sign in to comment.