summary refs log tree commit diff
path: root/mem.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-18 13:25:32 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-18 13:25:32 -0400
commitb8709501f944cb6421c6b4c447acfe8870c4ccc1 (patch)
tree11f0071982f643530a466881b11ab30cf588f66b /mem.c
parent47a0556a16e197246df78e341b820012b885d0bd (diff)
downloadroux-b8709501f944cb6421c6b4c447acfe8870c4ccc1.tar.gz
do not rewrite overwritten slots in memopt
Diffstat (limited to 'mem.c')
-rw-r--r--mem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mem.c b/mem.c
index b94f0a7..c59d7fe 100644
--- a/mem.c
+++ b/mem.c
@@ -43,6 +43,8 @@ memopt(Fn *fn)
 		/* specific to NAlign == 3 */
 		assert(rtype(i->to) == RTmp);
 		t = &fn->tmp[i->to.val];
+		if (t->ndef != 1)
+			goto Skip;
 		k = -1;
 		s = -1;
 		for (u=t->use; u != &t->use[t->nuse]; u++) {