aboutsummaryrefslogtreecommitdiffhomepage
path: root/regalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'regalloc.c')
-rw-r--r--regalloc.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/regalloc.c b/regalloc.c
index 1018e7c..68d6592 100644
--- a/regalloc.c
+++ b/regalloc.c
@@ -780,20 +780,17 @@ linearscan(struct rega *ra)
struct interval **unhandled = NULL;
struct interval *active = NULL, *inactive = NULL, *handled = NULL;
+ if (!intervals->count) return;
/* sort intervals */
{
extern int ninstr;
- unhandled = xcalloc(sizeof *unhandled * intervals->count);
+ unhandled = alloc(ra->arena, sizeof *unhandled * intervals->count, 0);
for (int i = 0; i < ninstr; ++i) {
if (!intervals->temps[i].nrange) continue;
unhandled[nunhandled++] = &intervals->temps[i];
}
assert(nunhandled == intervals->count);
- if (!nunhandled) {
- free(unhandled);
- return;
- }
sortintervals(unhandled, 0, nunhandled-1);
}
@@ -954,8 +951,6 @@ linearscan(struct rega *ra)
active = current;
}
}
-
- free(unhandled);
}
/* replace temps with physical regs, add loads & stores for spilled temps */