summary refs log tree commit diff
path: root/lisc/spill.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-04 12:19:55 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-04 12:19:55 -0500
commit059d378b9d4115061647b8efae95b3a7dc54abe2 (patch)
treec55498abca86a1e8b745b4b98fa33625b485bb79 /lisc/spill.c
parentfb838ce09547bc85da10dd447851536867e6f9a9 (diff)
downloadroux-059d378b9d4115061647b8efae95b3a7dc54abe2.tar.gz
fix hinting bug in spiller
We have to first free the output register of an instruction
before setting the interference hints for inregs temporaries.
Diffstat (limited to 'lisc/spill.c')
-rw-r--r--lisc/spill.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisc/spill.c b/lisc/spill.c
index aaec562..ea89fd9 100644
--- a/lisc/spill.c
+++ b/lisc/spill.c
@@ -478,9 +478,6 @@ spill(Fn *fn)
 						i->arg[n] = slot(t);
 					}
 				}
-			r = v.t[0] & (BIT(Tmp0)-1);
-			if (r)
-				sethint(&v, r);
 			reloads(&u, &v);
 			if (!req(i->to, R)) {
 				t = i->to.val;
@@ -488,6 +485,9 @@ spill(Fn *fn)
 				BCLR(v, t);
 			}
 			emiti(*i);
+			r = v.t[0] & (BIT(Tmp0)-1);
+			if (r)
+				sethint(&v, r);
 		}
 		assert(!r || b==fn->start);