]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
fix bug with input register thrashing introduced 2006-12-30
authorAleksey Demakov <ademakov@gmail.com>
Sun, 28 Jan 2007 20:14:57 +0000 (20:14 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Sun, 28 Jan 2007 20:14:57 +0000 (20:14 +0000)
ChangeLog
jit/jit-reg-alloc.c

index 9fe901bf7505a368f071f91de58d9920bdefe4f8..fef5ee0b11d1b5c901e821b5400dfb627a3b5fab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 2007-01-28  Aleksey Demakov  <ademakov@gmail.com>
 
-       * jit/jit-reg-alloc.c (_jit_regs_gen): fix recently introduced bug
-       with loading registers for ternary ops.
+       * jit/jit-reg-alloc.c (_jit_regs_gen, set_regdesc_flags): fix bugs
+       introduced 2006-12-30 with loading registers for ternary ops and
+       handling input register thrash.
 
 2007-01-26  Aleksey Demakov  <ademakov@gmail.com>
 
index 7910772aac5872bd1085ae6112060c621384146f..2e0960c8c5a57fbcbe21a24fd51c757ad2973431 100644 (file)
@@ -689,7 +689,6 @@ set_regdesc_flags(jit_gencode_t gen, _jit_regs_t *regs, int index)
                        {
                                reg = -1;
                                other_reg = -1;
-                               desc->store = 1;
                        }
                }
 
@@ -726,9 +725,8 @@ set_regdesc_flags(jit_gencode_t gen, _jit_regs_t *regs, int index)
                        clobber_input = ((clobber & CLOBBER_INPUT_VALUE) != 0);
                }
 
-               /* See if the input value needs to be saved before the
-                  instruction and if it stays or not in the register
-                  after the instruction. */
+               /* See if the input value needs to be stored before the
+                  instruction and if it stays in the register after it. */
                if(desc->value->is_constant)
                {
                        desc->kill = 1;
@@ -744,6 +742,12 @@ set_regdesc_flags(jit_gencode_t gen, _jit_regs_t *regs, int index)
                        desc->kill = 1;
                }
 
+               /* Store the value if it is going to be thrashed by another one. */
+               if(desc->thrash)
+               {
+                       desc->store = 1;
+               }
+
 #ifdef JIT_REG_STACK
                /* Count stack registers. */
                if(IS_STACK_REG(desc->reg))