aboutsummaryrefslogtreecommitdiff
path: root/live.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2016-04-12 14:40:11 -0400
committerQuentin Carbonneaux <[email protected]>2016-04-12 14:51:50 -0400
commit1f4ff634187a9127ab160b2651c9decd80e82435 (patch)
treee77976129d8ed6ad355f1bf4c2aae98fc635993e /live.c
parent4cee19ea9f989dc4b54bea3e657ec239929bf4d8 (diff)
subtle bug in liveness!
If on of the phis in a block A uses the result of another one when coming from B, we have to be careful!
Diffstat (limited to 'live.c')
-rw-r--r--live.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/live.c b/live.c
index 3265b3e..66c84e8 100644
--- a/live.c
+++ b/live.c
@@ -7,13 +7,13 @@ liveon(BSet *v, Blk *b, Blk *s)
uint a;
bscopy(v, s->in);
- for (p=s->phi; p; p=p->link) {
+ for (p=s->phi; p; p=p->link)
bsclr(v, p->to.val);
+ for (p=s->phi; p; p=p->link)
for (a=0; a<p->narg; a++)
if (p->blk[a] == b)
if (rtype(p->arg[a]) == RTmp)
bsset(v, p->arg[a].val);
- }
}
static int