From a44186227a823402e3be3d2a3c48755b5c2fb22d Mon Sep 17 00:00:00 2001 From: Aleksey Demakov Date: Wed, 1 Nov 2006 17:41:36 +0000 Subject: [PATCH] fixed a bug with coalescing values on x87-register stack --- ChangeLog | 8 +++++++- jit/jit-reg-alloc.c | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f686dc..0970924 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-11-01 Aleksey Demakov + + * jit/jit-reg-alloc.c (commit_input_value, commit_output_value): + do not increment/decrement the top of the register stack in case of + fp-value coalescing. + 2006-10-23 Aleksey Demakov * jit/jit-rules-x86.ins: JIT_OP_EXPAND_INT and JIT_OP_EXPAND_UINT @@ -79,7 +85,7 @@ * jit/jit-reg-alloc.h, jit/jit-reg-alloc.c: * tools/gen-rules-parser.y: add _JIT_REGS_CLOBBER_STACK flag and use - it in the code genearted for "only" rules instead of the explicit + it in the code generated for "only" rules instead of the explicit stack top check followed by the _jit_regs_spill_all() call. 2006-09-02 Aleksey Demakov diff --git a/jit/jit-reg-alloc.c b/jit/jit-reg-alloc.c index 9bae2bf..0d1b3b8 100644 --- a/jit/jit-reg-alloc.c +++ b/jit/jit-reg-alloc.c @@ -127,6 +127,10 @@ static void dump_regs(jit_gencode_t gen, const char *name) } putc('\n', stdout); } +#ifdef JIT_REG_STACK + printf("stack_top: %d\n", gen->reg_stack_top); +#endif + fflush(stdout); } #endif @@ -2274,7 +2278,7 @@ commit_input_value(jit_gencode_t gen, _jit_regs_t *regs, int index) if(desc->copy) { #ifdef JIT_REG_STACK - if(IS_STACK_REG(desc->reg)) + if(IS_STACK_REG(desc->reg) && !regs->copy) { --(gen->reg_stack_top); } @@ -2299,7 +2303,7 @@ commit_input_value(jit_gencode_t gen, _jit_regs_t *regs, int index) } unbind_value(gen, desc->value, reg, other_reg); #ifdef JIT_REG_STACK - if(IS_STACK_REG(reg)) + if(IS_STACK_REG(reg) && !regs->copy) { --(gen->reg_stack_top); } @@ -2334,7 +2338,7 @@ commit_output_value(jit_gencode_t gen, _jit_regs_t *regs) } #ifdef JIT_REG_STACK - if(IS_STACK_REG(desc->reg)) + if(IS_STACK_REG(desc->reg) && !regs->copy) { ++(gen->reg_stack_top); } -- 2.47.3