summary refs log tree commit diff
path: root/rega.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2019-03-09 22:35:09 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2019-03-09 22:35:09 +0100
commitbcc90d074e91c8e5d65876225d0b9f2c91c4248d (patch)
tree0516f02f701eebb5256809df174bd33cb8cbdf07 /rega.c
parentb15a6d47dc666d660c9cb5b7b75337492896902c (diff)
downloadroux-bcc90d074e91c8e5d65876225d0b9f2c91c4248d.tar.gz
make sure phis are temporaries in rega
In fact, after spilling, a phi
can be a temporary or a slot.

I am now pondering whether this
is a good idea or not because
it causes annoying mem->mem
movs after register allocation.
Diffstat (limited to 'rega.c')
-rw-r--r--rega.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rega.c b/rega.c
index 6f1da50..8f2fbd0 100644
--- a/rega.c
+++ b/rega.c
@@ -562,8 +562,8 @@ rega(Fn *fn)
 		 * predecessor, we have to find the
 		 * corresponding argument */
 		for (p=s->phi; p; p=p->link) {
-			r = rfind(m, p->to.val);
-			if (r == -1)
+			if (rtype(p->to) != RTmp
+			|| (r=rfind(m, p->to.val)) == -1)
 				continue;
 			for (u=0; u<p->narg; u++) {
 				b = p->blk[u];