From 40f1c14f7594f6e979316ad8f6bfff51341ad33d Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 7 Jul 2023 09:08:38 +0200 Subject: regalloc: update preds during simplify pass --- regalloc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'regalloc.c') diff --git a/regalloc.c b/regalloc.c index 096ad87..25dce98 100644 --- a/regalloc.c +++ b/regalloc.c @@ -762,7 +762,13 @@ regalloc(struct function *fn) if (p->s1 == blk) p->s1 = next; else if (p->s2 == blk) p->s2 = next; else continue; - goto DelBlk; + for (int i = 0; i < next->npred; ++i) { + if (blkpred(next, i) == blk) { + blkpred(next, i) = p; + goto DelBlk; + } + } + assert(0); } } } while ((blk = blk->lnext) != fn->entry); -- cgit v1.2.3