We find that the "new_base" doesn't change during in the following loop, so we 
can outer this judgement from this loop.

Signed-off-by: Wanghuang <qemu_wanghu...@126.com>

diff --git a/qemu/tcg/optimize.c b/qemu-local/tcg/optimize.c

index 9c65474..27164f0 100644

--- a/qemu/tcg/optimize.c

+++ b/qemu-local/tcg/optimize.c

@@ -67,12 +67,12 @@ static void reset_temp(TCGArg temp, int nb_temps, int 
nb_globals)

                 break;

             }

         }

-        for (i = temps[temp].next_copy; i != temp; i = temps[i].next_copy) {

-            if (new_base == (TCGArg)-1) {

+       if (new_base == (TCGArg)-1) {

+           for (i = temps[temp].next_copy; i != temp; i = temps[i].next_copy) 

                 temps[i].state = TCG_TEMP_ANY;

-            } else {

+       } else { 

+          for (i = temps[temp].next_copy; i != temp; i = temps[i].next_copy) 

                 temps[i].val = new_base;

-            }

         }

         temps[temps[temp].next_copy].prev_copy = temps[temp].prev_copy;

         temps[temps[temp].prev_copy].next_copy = temps[temp].next_copy;


Reply via email to