]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
change conditions for local and frame patterns to account for the case when
authorAleksey Demakov <ademakov@gmail.com>
Mon, 12 Feb 2007 00:18:27 +0000 (00:18 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Mon, 12 Feb 2007 00:18:27 +0000 (00:18 +0000)
the use of the value is compiled before its first definition

ChangeLog
tools/gen-rules-parser.y

index c4e9e84e5c25d3053df1b3652e3853f6225290c6..f3e7d800d36103a812c5dd55b5956d8437dc57de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        (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  <ktreichel@web.de>
 
        * jit/jit-function.c: Use the on-demand compilation driver in
index ea9513594dc495ab74b475cb0a79c6f243eeebff..8bebf8dbabaf71e7163ea778b271183f50cf6be5 100644 (file)
@@ -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;