From: Aleksey Demakov Date: Sun, 28 Jan 2007 20:14:57 +0000 (+0000) Subject: fix bug with input register thrashing introduced 2006-12-30 X-Git-Tag: before.move.to.git~157 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=cab0deaa5a93ef9f1013f266873b9ef9efc0d322;p=francis%2Flibjit.git fix bug with input register thrashing introduced 2006-12-30 --- diff --git a/ChangeLog b/ChangeLog index 9fe901b..fef5ee0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2007-01-28 Aleksey Demakov - * 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 diff --git a/jit/jit-reg-alloc.c b/jit/jit-reg-alloc.c index 7910772..2e0960c 100644 --- a/jit/jit-reg-alloc.c +++ b/jit/jit-reg-alloc.c @@ -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))