summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
Diffstat (limited to 'lisc')
-rw-r--r--lisc/mem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisc/mem.c b/lisc/mem.c
index ea4bd82..75eacb8 100644
--- a/lisc/mem.c
+++ b/lisc/mem.c
@@ -29,8 +29,9 @@ memopt(Fn *fn)
 			if (u->type != UIns)
 				goto NextIns;
 			l = u->u.ins;
-			if (l->op < OStorel || l->op > OStoreb)
 			if (l->op < OLoadl || l->op > OLoadub)
+			if (l->op < OStorel || l->op > OStoreb
+			|| req(i->to, l->arg[0]))
 				goto NextIns;
 		}
 		/* get rid of the alloc and replace uses */