diff options
| -rw-r--r-- | ir/builder.c | 3 | ||||
| -rw-r--r-- | ir/regalloc.c | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/ir/builder.c b/ir/builder.c index ee83961..3ddb5a6 100644 --- a/ir/builder.c +++ b/ir/builder.c @@ -218,8 +218,7 @@ useblk(struct function *fn, struct block *blk) blk->lnext = fn->entry; blk->lprev = fn->entry->lprev; blk->lprev->lnext = blk; - blk->id = blk->lprev->id + 1; - ++fn->nblk; + blk->id = ++fn->nblk; fn->entry->lprev = blk; } fn->curblk = blk; diff --git a/ir/regalloc.c b/ir/regalloc.c index 9abd3c6..bb7eff1 100644 --- a/ir/regalloc.c +++ b/ir/regalloc.c @@ -116,7 +116,7 @@ fixlive(struct function *fn) } while ((blk = blk->lnext) != fn->entry); if (ccopt.dbg.l) { - DBG("<< After liveness fixup >>\n"); + efmt("<< After liveness fixup >>\n"); irdump(fn); } if (defined != definedbuf) free(defined); @@ -262,7 +262,7 @@ emitmove(enum irclass k, struct alloc dst, struct alloc src, struct block *blk, else reg = kisint(k) ? mctarg->gprscratch : mctarg->fprscratch; mv.reg = reg+1; - addstkslotref(insertinstr(blk, curi, mv).i, src.a*8); + addstkslotref(insertinstr(blk, curi++, mv).i, src.a*8); } else reg = src.a; if (dst.t == ASTACK) { mv = mkinstr(Ostore8+ilog2(cls2siz[k]), 0, .r = mkref(RREG, reg)); @@ -1255,7 +1255,7 @@ regalloc(struct function *fn) fillblkids(fn); if (ccopt.dbg.r) { - DBG("<< Before linear scan >>\n"); + bfmt(ccopt.dbgout, "<< Before linear scan >>\n"); irdump(fn); } @@ -1292,7 +1292,7 @@ regalloc(struct function *fn) vfree(&stkslotrefs); if (ccopt.dbg.r) { - DBG("<< After regalloc >>\n"); + bfmt(ccopt.dbgout, "<< After regalloc >>\n"); irdump(fn); } } |