summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-12-29 17:58:56 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-12-29 17:58:56 -0500
commite9ccf35b8a18b542603714c84fa2869b24a17af0 (patch)
tree2c0916042c5cdee2a3f848b0bf0ccec35d610f48
parent7815610cd8af498beac01d3ae6a1c9b20f1f0a8d (diff)
downloadroux-e9ccf35b8a18b542603714c84fa2869b24a17af0.tar.gz
do not create useless mem refs
-rw-r--r--isel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/isel.c b/isel.c
index 9a60554..708cc0d 100644
--- a/isel.c
+++ b/isel.c
@@ -162,7 +162,7 @@ seladdr(Ref *r, ANum *an, Fn *fn)
 	r0 = *r;
 	if (rtype(r0) == RTmp) {
 		amatch(&a, r0, an, fn, 1);
-		if (req(a.base, R))
+		if (req(a.base, R) || req(a.base, r0))
 			return;
 		chuse(r0, -1, fn);
 		vgrow(&fn->mem, ++fn->nmem);