summaryrefslogtreecommitdiff
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-10-31 00:50:15 +0100
committerAurelien Jarno <aurelien@aurel32.net>2012-10-31 22:20:45 +0100
commitb3a1be87bac3a6aaa59bb88c1410f170dc9b22d5 (patch)
tree23e0acd4a0d8f5fd8799e38b2205f019b28c00a3 /tcg/tcg.c
parente1e1b25c97632cf68d6a11e20f8068282e3d7915 (diff)
downloadqemu-b3a1be87bac3a6aaa59bb88c1410f170dc9b22d5.tar.gz
tcg: don't remove op if output needs to be synced to memory
Commit 9c43b68de628a1e2cba556adfb71c17028eb802e do not correctly check for dead outputs when they need to be synced to memory in case of half-dead operations. Fix that by applying the same pattern than for the default case. Tested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index c3a7f19bd7..11334387a0 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1329,8 +1329,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]]) {
- if (dead_temps[args[0]]) {
+ if (dead_temps[args[1]] && !mem_temps[1]) {
+ if (dead_temps[args[0]] && !mem_temps[0]) {
goto do_remove;
}
/* Create the single operation plus nop. */
@@ -1355,8 +1355,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]]) {
- if (dead_temps[args[0]]) {
+ if (dead_temps[args[1]] && !mem_temps[1]) {
+ if (dead_temps[args[0]] && !mem_temps[0]) {
goto do_remove;
}
gen_opc_buf[op_index] = op = INDEX_op_mul_i32;