qbe

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

commit abbe53285f032e4804d86baff59ac5ac49795df7
parent 4699fb7663961b3dab2591f2165be62fda47c3e8
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Sat, 15 Aug 2015 20:48:30 -0400

clobber check code was wrong in dopm()

Diffstat:
Mlisc/rega.c | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lisc/rega.c b/lisc/rega.c @@ -238,17 +238,17 @@ dopm(Blk *b, Ins *i, RMap *m) else if (isreg(i->arg[0])) for (;; i--) { r = RBASE(i->arg[0].val); - if (req(i->to, R)) { - if (BGET(m->b, r)) { - for (n=0; m->r[n] != r; n++) - assert(n+1 < m->n); - t = m->t[n]; - rfree(m, t); - BSET(m->b, r); - rt = ralloc(m, t); - pmadd(rt, i->arg[0]); - } - } else if (BGET(m->b, i->to.val)) { + if (BGET(m->b, r)) { + for (n=0; m->r[n] != r; n++) + assert(n+1 < m->n); + t = m->t[n]; + rfree(m, t); + BSET(m->b, r); + rt = ralloc(m, t); + BCLR(m->b, r); + pmadd(rt, i->arg[0]); + } + if (!req(i->to, R) && BGET(m->b, i->to.val)) { rt = reg(rfree(m, i->to.val), i->to.val); pmadd(i->arg[0], rt); }