diff options
-rw-r--r-- | lisc/copy.c | 4 | ||||
-rw-r--r-- | lisc/isel.c | 6 | ||||
-rw-r--r-- | lisc/ssa.c | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lisc/copy.c b/lisc/copy.c index 0e62ed7..1daca2b 100644 --- a/lisc/copy.c +++ b/lisc/copy.c @@ -85,7 +85,7 @@ copy(Fn *fn) for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) visitphi(p, cp, &w); - for (i=b->ins; i!=&b->ins[b->nins]; i++) + for (i=b->ins; i-b->ins < b->nins; i++) visitins(i, cp, &w); } while ((w1=w)) { @@ -123,7 +123,7 @@ copy(Fn *fn) } pp=&p->link; } - for (i=b->ins; i!=&b->ins[b->nins]; i++) { + for (i=b->ins; i-b->ins < b->nins; i++) { r = cp[i->to.val]; if (!req(r, i->to)) { *i = (Ins){.op = ONop}; diff --git a/lisc/isel.c b/lisc/isel.c index 18b3e43..fbbef26 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -674,7 +674,7 @@ anumber(ANum *ai, Blk *b, Con *con) int a, a1, a2, n1, n2, t1, t2; Ins *i; - for (i=b->ins; i<&b->ins[b->nins]; i++) { + for (i=b->ins; i-b->ins < b->nins; i++) { if (rtype(i->to) == RTmp) ai[i->to.val].i = i; if (i->op != OAdd && i->op != OMul) @@ -804,7 +804,7 @@ isel(Fn *fn) /* lower function calls */ for (b=fn->start; b; b=b->link) { curi = &insb[NIns]; - for (i=&b->ins[b->nins]; i>b->ins;) { + for (i=&b->ins[b->nins]; i!=b->ins;) { if ((--i)->op == OCall) { for (i0=i; i0>b->ins; i0--) if ((i0-1)->op != OArg) @@ -863,7 +863,7 @@ isel(Fn *fn) anumber(ainfo, b, fn->con); curi = &insb[NIns]; seljmp(b, fn); - for (i=&b->ins[b->nins]; i>b->ins;) + for (i=&b->ins[b->nins]; i!=b->ins;) sel(*--i, ainfo, fn); b->nins = &insb[NIns] - curi; idup(&b->ins, curi, b->nins); diff --git a/lisc/ssa.c b/lisc/ssa.c index 7a7f55e..ac90b6e 100644 --- a/lisc/ssa.c +++ b/lisc/ssa.c @@ -63,7 +63,7 @@ filluse(Fn *fn) tmp[t].phi = p->to.val; } } - for (i=b->ins; i!=&b->ins[b->nins]; i++) { + for (i=b->ins; i-b->ins < b->nins; i++) { if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); tmp[i->to.val].ndef++; @@ -303,7 +303,7 @@ phiins(Fn *fn) for (b=fn->start; b; b=b->link) { b->visit = 0; r = R; - for (i=b->ins; i!=&b->ins[b->nins]; i++) { + for (i=b->ins; i-b->ins < b->nins; i++) { if (!req(r, R)) { if (req(i->arg[0], TMP(t))) i->arg[0] = r; @@ -438,7 +438,7 @@ renblk(Blk *b, Name **stk, Fn *fn) for (p=b->phi; p; p=p->link) rendef(&p->to, b, stk, fn); - for (i=b->ins; i!=&b->ins[b->nins]; i++) { + for (i=b->ins; i-b->ins < b->nins; i++) { for (m=0; m<2; m++) { t = i->arg[m].val; if (rtype(i->arg[m]) == RTmp) |