]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
_jit_regs_load_to_top_two: handle the case where the second value
authorRhys Weatherley <rweather@southern-storm.com.au>
Tue, 11 May 2004 06:16:32 +0000 (06:16 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Tue, 11 May 2004 06:16:32 +0000 (06:16 +0000)
is on the stack but not the first.

ChangeLog
jit/jit-reg-alloc.c

index 00e3c0d71b8dcd5890139899289d9e397762e60b..4a8db29eaf974acfbcdf0f147d0a702b3f6cadda 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
        fix a bug that caused global variables in Dynamic Pascal
        to be incorrectly allocated as locals.
 
+       * jit/jit-reg-alloc.c (_jit_regs_load_to_top_two): handle the
+       case where the second value is on the stack but not the first.
+
 2004-05-10  Rhys Weatherley  <rweather@southern-storm.com.au>
 
        * jit/jit-reg-alloc.c, jit/jit-reg-alloc.h, jit/jit-rules-interp.c:
index d77c00cae35a3589d408950f5f29e174338dab3c..4a5e17394a91c1a8bb685a14da3207f717629eb4 100644 (file)
@@ -1142,6 +1142,11 @@ int _jit_regs_load_to_top_two
                }
                spill_all_stack(gen, type_reg);
        }
+       else if(value2->in_register && !(value->in_register))
+       {
+               /* We'll probably need to rearrange the stack, so spill first */
+               spill_all_stack(gen, type_reg);
+       }
 
        /* If there are free registers of this type, then load the values now */
        if(stack_regs_free(gen, type_reg, 2))