summary refs log tree commit diff
path: root/lisc/rega.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-15 20:48:30 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:31 -0400
commitabbe53285f032e4804d86baff59ac5ac49795df7 (patch)
tree1ba1ed4d50a5a1e88711684481c525bcb7e01851 /lisc/rega.c
parent4699fb7663961b3dab2591f2165be62fda47c3e8 (diff)
downloadroux-abbe53285f032e4804d86baff59ac5ac49795df7.tar.gz
clobber check code was wrong in dopm()
Diffstat (limited to 'lisc/rega.c')
-rw-r--r--lisc/rega.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisc/rega.c b/lisc/rega.c
index b31f7a4..d6445c3 100644
--- a/lisc/rega.c
+++ b/lisc/rega.c
@@ -238,17 +238,17 @@ dopm(Blk *b, Ins *i, RMap *m)
 	else if (isreg(i->arg[0]))
 		for (;; i--) {
 			r = RBASE(i->arg[0].val);
-			if (req(i->to, R)) {
-				if (BGET(m->b, r)) {
-					for (n=0; m->r[n] != r; n++)
-						assert(n+1 < m->n);
-					t = m->t[n];
-					rfree(m, t);
-					BSET(m->b, r);
-					rt = ralloc(m, t);
-					pmadd(rt, i->arg[0]);
-				}
-			} else if (BGET(m->b, i->to.val)) {
+			if (BGET(m->b, r)) {
+				for (n=0; m->r[n] != r; n++)
+					assert(n+1 < m->n);
+				t = m->t[n];
+				rfree(m, t);
+				BSET(m->b, r);
+				rt = ralloc(m, t);
+				BCLR(m->b, r);
+				pmadd(rt, i->arg[0]);
+			}
+			if (!req(i->to, R) && BGET(m->b, i->to.val)) {
 				rt = reg(rfree(m, i->to.val), i->to.val);
 				pmadd(i->arg[0], rt);
 			}