aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-11-02 19:26:20 +0100
committer lemon<lsof@mailbox.org>2025-11-02 19:26:20 +0100
commit088c3c1ce51de82ef317592bae766ad20f82208d (patch)
treee94f30be7158f6b5cd97224883db584a7340d56b /ir
parentfab6314ffcb547cbbf45ce16e390eba00e5bfa31 (diff)
regalloc: misc
Diffstat (limited to 'ir')
-rw-r--r--ir/regalloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ir/regalloc.c b/ir/regalloc.c
index 03d9413..fae1a61 100644
--- a/ir/regalloc.c
+++ b/ir/regalloc.c
@@ -982,18 +982,18 @@ devirt(struct rega *ra, struct block *blk)
int tr;
if (r->t == RTMP) {
alloc = (it = &ra->intervals.temps[r->i]) && it->nrange ? &it->alloc : NULL;
- if (alloc->t == ASTACK && ins->op == Omove) {
+ if (alloc && alloc->t == ASTACK && ins->op == Omove) {
/* move [reg], [stk] -> [reg] = load [stk] */
assert(r == &ins->r && ins->l.t == RREG);
ins->reg = ins->l.i+1;
ins->op = cls2load[ins->cls];
ins->r = NOREF;
addstkslotref(temp, alloc->a*8);
- } else if (alloc->t == ASTACK && ins->op == Ocopy && r == &ins->l && ins->reg) {
+ } else if (alloc && alloc->t == ASTACK && ins->op == Ocopy && r == &ins->l && ins->reg) {
/* [reg] = copy [stk] -> [reg] = load [stk] */
ins->op = cls2load[ins->cls];
addstkslotref(temp, alloc->a*8);
- } else if (alloc->t == ASTACK) {
+ } else if (alloc && alloc->t == ASTACK) {
/* ref was spilled, gen load to scratch register and use it */
struct instr ld = {.cls = insrescls(instrtab[r->i])};
int reg = kisint(ld.cls) ? mctarg->gprscratch : mctarg->fprscratch;