From 215914f58d363b6622b37079fb22073415cfb4b8 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 23 Dec 2015 17:05:41 -0500 Subject: missing case in tmpuse() of spiller --- lisc/spill.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lisc/spill.c') diff --git a/lisc/spill.c b/lisc/spill.c index 40bd326..7f967e4 100644 --- a/lisc/spill.c +++ b/lisc/spill.c @@ -31,14 +31,20 @@ loopmark(Blk *hd, Blk *b, Phi *p) static void tmpuse(Ref r, int use, int loop, Fn *fn) { + Mem *m; Tmp *t; - if (rtype(r) != RTmp || r.val < Tmp0) - return; - t = &fn->tmp[r.val]; - t->nuse += use; - t->ndef += !use; - t->cost += loop; + if (rtype(r) == RAMem) { + m = &fn->mem[r.val & AMask]; + tmpuse(m->base, 1, loop, fn); + tmpuse(m->index, 1, loop, fn); + } + else if (rtype(r) == RTmp && r.val >= Tmp0) { + t = &fn->tmp[r.val]; + t->nuse += use; + t->ndef += !use; + t->cost += loop; + } } /* evaluate spill costs of temporaries, -- cgit 1.4.1