summary refs log tree commit diff
path: root/lisc/ssa.c
diff options
context:
space:
mode:
Diffstat (limited to 'lisc/ssa.c')
-rw-r--r--lisc/ssa.c6
1 files changed, 3 insertions, 3 deletions
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)