summary refs log tree commit diff
path: root/amd64
diff options
context:
space:
mode:
authorEmil Skoeldberg <emil@skoeldberg.net>2018-04-26 18:11:55 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2018-04-26 22:49:36 +0200
commite7a387585992a9378ba2f2319c2408c62a0b14e8 (patch)
treef7d21d2165b8017f3a28a3452a0da716f8e34b87 /amd64
parent39b1f468b09d94cac6ec65a8c0fbc210e3c9989e (diff)
downloadroux-e7a387585992a9378ba2f2319c2408c62a0b14e8.tar.gz
Fix compiler warnings.
Compiler warned about comparison between signed and unsigned values.
Diffstat (limited to 'amd64')
-rw-r--r--amd64/isel.c4
-rw-r--r--amd64/sysv.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/amd64/isel.c b/amd64/isel.c
index 46ed259..cb409c4 100644
--- a/amd64/isel.c
+++ b/amd64/isel.c
@@ -458,7 +458,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)
@@ -574,7 +574,7 @@ amd64_isel(Fn *fn)
 	b = fn->start;
 	/* specific to NAlign == 3 */ /* or change n=4 and sz /= 4 below */
 	for (al=Oalloc, n=4; al<=Oalloc1; al++, n*=2)
-		for (i=b->ins; i-b->ins < b->nins; i++)
+		for (i=b->ins; i<&b->ins[b->nins]; i++)
 			if (i->op == al) {
 				if (rtype(i->arg[0]) != RCon)
 					break;
diff --git a/amd64/sysv.c b/amd64/sysv.c
index 014452a..d70e70d 100644
--- a/amd64/sysv.c
+++ b/amd64/sysv.c
@@ -642,7 +642,7 @@ amd64_sysv_abi(Fn *fn)
 		b->visit = 0;
 
 	/* lower parameters */
-	for (b=fn->start, i=b->ins; i-b->ins<b->nins; i++)
+	for (b=fn->start, i=b->ins; i<&b->ins[b->nins]; i++)
 		if (!ispar(i->op))
 			break;
 	fa = selpar(fn, b->ins, i);