Permalink
Browse files

free more unused regs

  • Loading branch information...
1 parent eddba64 commit c36f3e8e16c9a856282a794bd7ae3a92f87a95b4 Jimmy Zhuo committed Jul 9, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 src/gencode.c
  2. +1 −1 src/main.c
View
@@ -2010,6 +2010,7 @@ gencode_var(M1_compiler *comp, m1_var *v) {
INS (M0_ADD_I, "%I, %I, %I", index.no, index.no, one.no);
iter = iter->next;
+ free_reg(comp, res);
}
free_reg(comp, index);
free_reg(comp, one);
@@ -2152,6 +2153,7 @@ gencode_expr(M1_compiler *comp, m1_expression *e) {
INS (M0_DEREF, "%R, %R, %R", target, parent, index);
+ free_reg(comp, index);
pushreg(comp->regstack, target);
--num_regs; /* popped 2, pushed 1. */
}
View
@@ -45,7 +45,7 @@ main(int argc, char *argv[]) {
yyscan_t yyscanner;
M1_compiler comp;
int turnoff_reg_opt = 0;
- char *outputfile = "a.m1";
+ char *outputfile = "a.m0";
if (argc <= 1) {
fprintf(stderr, "Usage: m1 <file>\n");

0 comments on commit c36f3e8

Please sign in to comment.