Patchwork [09/13] tcg: start with local temps in TEMP_VAL_MEM state

login
register
mail settings
Submitter Aurelien Jarno
Date Sept. 27, 2012, 5:15 p.m.
Message ID <1348766113-18373-10-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/187428/
State New
Headers show

Comments

Aurelien Jarno - Sept. 27, 2012, 5:15 p.m.
Start with local temps in TEMP_VAL_MEM state, to make possible a later
check that all the temps are correctly saved back to memory.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/tcg.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Richard Henderson - Sept. 27, 2012, 7:10 p.m.
On 09/27/2012 10:15 AM, Aurelien Jarno wrote:
> Start with local temps in TEMP_VAL_MEM state, to make possible a later
> check that all the temps are correctly saved back to memory.
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

Patch

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 71dd2ad..9e12be8 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -781,7 +781,11 @@  static void tcg_reg_alloc_start(TCGContext *s)
     }
     for(i = s->nb_globals; i < s->nb_temps; i++) {
         ts = &s->temps[i];
-        ts->val_type = TEMP_VAL_DEAD;
+        if (ts->temp_local) {
+            ts->val_type = TEMP_VAL_MEM;
+        } else {
+            ts->val_type = TEMP_VAL_DEAD;
+        }
         ts->mem_allocated = 0;
         ts->fixed_reg = 0;
     }