aboutsummaryrefslogtreecommitdiffhomepage
path: root/regalloc.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-09-17 09:49:22 +0200
committerlemon <lsof@mailbox.org>2025-09-17 09:49:22 +0200
commit960f79fa50009fd1e95a294547e3e46494d49484 (patch)
tree93fbb3bb326f7efb8cfdfb249f0d1b76ef25d3bc /regalloc.c
parent3d0c49f4eb9e13e00bf12940b53da0f018c0a58c (diff)
alloc changes
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 */