diff options
| author | 2025-10-26 10:36:30 +0100 | |
|---|---|---|
| committer | 2025-10-26 10:36:30 +0100 | |
| commit | ba5446b5cb8330f8e318b8efccebeed7bd23e0f4 (patch) | |
| tree | 6a61e888fb1d07068378911fec6e849fa8f451c6 | |
| parent | 4804308f98455b33db7da70303bdefa4f08d88ee (diff) | |
rega: fix Ocopy of stk->stk
| -rw-r--r-- | ir/regalloc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ir/regalloc.c b/ir/regalloc.c index f29cdf8..7d3a7ba 100644 --- a/ir/regalloc.c +++ b/ir/regalloc.c @@ -2,7 +2,7 @@ /** Implements linear scan register allocation **/ -#if 1 +#if 0 #define DBG(...) if(ccopt.dbg.r) efmt(__VA_ARGS__) #else #define DBG(...) ((void)0) @@ -976,9 +976,8 @@ devirt(struct rega *ra, struct block *blk) ins->op = cls2load[ins->cls]; ins->r = NOREF; addstkslotref(temp, alloc->a*8); - } else if (alloc->t == ASTACK && ins->op == Ocopy && r == &ins->l) { + } else if (alloc->t == ASTACK && ins->op == Ocopy && r == &ins->l && ins->reg) { /* [reg] = copy [stk] -> [reg] = load [stk] */ - assert(ins->reg); ins->op = cls2load[ins->cls]; addstkslotref(temp, alloc->a*8); } else if (alloc->t == ASTACK) { |