qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 7540024f78e1a40506884adad4803c2fccf154ff
parent 559617855a841ebe0dda3ec7f36daf7b36b33d38
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Thu, 17 Sep 2015 19:56:39 -0400

fix two bugs in selpar()

- One missing argument for OAlloc.
- One reference shuffling.

Diffstat:
Mlisc/isel.c | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisc/isel.c b/lisc/isel.c @@ -638,14 +638,15 @@ selpar(Fn *fn, Ins *i0, Ins *i1) ; r1 = newtmp(fn); r = TMP(a->rty[0]); - *curi++ = (Ins){OAlloc+al, 1, r1, {R}}; + r2 = newcon(a->size, fn); + *curi++ = (Ins){OAlloc+al, 1, r1, {r2}}; *curi++ = (Ins){OStorel, 0, R, {r, r1}}; if (a->size > 8) { - r1 = newtmp(fn); + r = newtmp(fn); r2 = newcon(8, fn); - *curi++ = (Ins){OAdd, 1, r1, {r, r2}}; - r = TMP(a->rty[1]); - *curi++ = (Ins){OStorel, 0, R, {r, r1}}; + *curi++ = (Ins){OAdd, 1, r, {r1, r2}}; + r1 = TMP(a->rty[1]); + *curi++ = (Ins){OStorel, 0, R, {r1, r}}; } } for (a=&ac[i1-i0], stk=0; a>ac;) {