aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regalloc.c2
-rw-r--r--src/ssa.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/regalloc.c b/src/regalloc.c
index 6265c6d..61a90b1 100644
--- a/src/regalloc.c
+++ b/src/regalloc.c
@@ -184,7 +184,7 @@ static void build_active_between(struct vec *active, struct vec *prev_active, st
* the lifetimes vector */
if (prev_active)
foreach_lifetime(li, *prev_active) {
- struct lifetime l = lifetime_at(*lifetimes, li);
+ struct lifetime l = lifetime_at(*prev_active, li);
if (l.end <= start)
continue;
diff --git a/src/ssa.c b/src/ssa.c
index 7af342b..74ad59a 100644
--- a/src/ssa.c
+++ b/src/ssa.c
@@ -72,6 +72,9 @@ top:
}
b = vect_pop(struct blk *, stack);
+ if (done(b, visited))
+ goto top;
+
if (return_blk(b)) {
b->s1 = NULL;
b->s2 = NULL;
@@ -185,13 +188,16 @@ top:
}
b = vect_pop(struct blk *, stack);
+ if (done(b, visited))
+ goto top;
+
if (!entered(b, visited)) {
vec_append(&stack, &b);
if (b->s1)
vec_append(&stack, &b->s1);
- if (b->s2)
+ if (b->s2 && b->s2 != b->s1)
vec_append(&stack, &b->s2);
enter(b);