From 08343ad1d873024028554354e7298b7d7a59882d Mon Sep 17 00:00:00 2001 From: Aleksey Demakov Date: Mon, 12 Feb 2007 00:18:27 +0000 Subject: [PATCH] change conditions for local and frame patterns to account for the case when the use of the value is compiled before its first definition --- ChangeLog | 8 ++++++++ tools/gen-rules-parser.y | 15 ++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4e9e84..f3e7d80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,14 @@ (clobbers_register, spill_clobbered_register, _jit_regs_gen): fix a problem that shows up with the new cleanup method. + * tools/gen-rules-parser.y (gensel_output_clauses): the conditions + for the local and frame patterns are changed. If the value is used + before it is defined then both in_frame and in_register flags are + clear. This situation is perfectly valid if there is a backward + branch form a point after the definition to a point before the use. + So if the value is not a constant and it is not in a register assume + that it is on the stack even if the in_frame flag is not set. + 2007-02-10 Klaus Treichel * jit/jit-function.c: Use the on-demand compilation driver in diff --git a/tools/gen-rules-parser.y b/tools/gen-rules-parser.y index ea95135..8bebf8d 100644 --- a/tools/gen-rules-parser.y +++ b/tools/gen-rules-parser.y @@ -1104,8 +1104,9 @@ static void gensel_output_clauses(gensel_clause_t clauses, gensel_option_t optio { printf(" && "); } - printf("insn->%s->in_frame && !insn->%s->in_register", - args[index], args[index]); + printf("!insn->%s->is_constant && ", args[index]); + printf("!insn->%s->in_register && ", args[index]); + printf("!insn->%s->has_global_register", args[index]); seen_option = 1; ++index; break; @@ -1115,7 +1116,8 @@ static void gensel_output_clauses(gensel_clause_t clauses, gensel_option_t optio { printf(" && "); } - printf("!insn->%s->is_constant", args[index]); + printf("!insn->%s->is_constant && ", args[index]); + printf("!insn->%s->has_global_register", args[index]); seen_option = 1; ++index; break; @@ -1281,15 +1283,18 @@ static void gensel_output_clauses(gensel_clause_t clauses, gensel_option_t optio case GENSEL_PATT_IMMU8: case GENSEL_PATT_IMMS16: case GENSEL_PATT_IMMU16: + ++index; + break; + case GENSEL_PATT_LOCAL: + printf("\t\t_jit_gen_fix_value(insn->%s);\n", args[index]); ++index; break; case GENSEL_PATT_FRAME: printf("\t\t_jit_regs_force_out(gen, insn->%s, %d);\n", args[index], (free_dest && index == 0)); - printf("\t\t_jit_gen_fix_value(insn->%s);\n", - args[index]); + printf("\t\t_jit_gen_fix_value(insn->%s);\n", args[index]); ++index; break; -- 2.47.3