summary refs log tree commit diff
path: root/lisc/rega.c
diff options
context:
space:
mode:
Diffstat (limited to 'lisc/rega.c')
-rw-r--r--lisc/rega.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisc/rega.c b/lisc/rega.c
index 1263c6a..e792d55 100644
--- a/lisc/rega.c
+++ b/lisc/rega.c
@@ -320,10 +320,10 @@ rega(Fn *fn)
 		for (i=&b->ins[b->nins]; i!=b->ins;) {
 			switch ((--i)->op) {
 			case OCall:
-				rs = calldef(*i, 0) | callclb(*i, 0);
-				for (r=0; r<NReg; r++)
-					if ((1ll << r) & rs)
-						rfree(&cur, r);
+				rs = calluse(*i, 0);
+				for (r=0; r<NRSave; r++)
+					if (!((1ll << rsave[r]) & rs))
+						rfree(&cur, rsave[r]);
 				continue;
 			case OCopy:
 				if (!isreg(i->arg[0]))