From 630127c68b872dcb7ddb22079f91f001b73945fc Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 12 Feb 2022 02:27:46 -0800 Subject: [PATCH] spill: consider jump argument as use of register --- spill.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spill.c b/spill.c index 4c11d9f..2ce1d4f 100644 --- a/spill.c +++ b/spill.c @@ -412,6 +412,20 @@ spill(Fn *fn) bscopy(b->out, v); /* 2. process the block instructions */ + if (rtype(b->jmp.arg) == RTmp) { + t = b->jmp.arg.val; + assert(KBASE(tmp[t].cls) == 0); + lvarg[0] = bshas(v, t); + bsset(v, t); + bscopy(u, v); + limit2(v, 0, 0, NULL); + if (!bshas(v, t)) { + if (!lvarg[0]) + bsclr(u, t); + b->jmp.arg = slot(t); + } + reloads(u, v); + } curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { i--;