diff mbox

[for-2.4] tcg: mark temps as mem_coherent=0 for mov with a constant

Message ID 1437974440-13543-1-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno July 27, 2015, 5:20 a.m. UTC
When a constant has to be loaded in a mov op, we fail to assign
mem_coherent = 0. This patch fixes that.

Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/tcg.c | 1 +
 1 file changed, 1 insertion(+)

I found this issue by review. I haven't been able to trigger it with the
x86 backend, but I wouldn't be surprised if we can trigger it with other
backends, so better fix it for 2.4.
diff mbox

Patch

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 9a2508b..0892a9b 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1894,6 +1894,7 @@  static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def,
             ts->mem_coherent = 1;
         } else if (ts->val_type == TEMP_VAL_CONST) {
             tcg_out_movi(s, itype, ts->reg, ts->val);
+            ts->mem_coherent = 0;
         }
         s->reg_to_temp[ts->reg] = args[1];
         ts->val_type = TEMP_VAL_REG;