qbe

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

commit b5a009347e75df5ccb48736e22dff06ab9194658
parent 9bb69bf4c7dae1e15fb505e0a54d950f9621df84
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Fri, 11 Sep 2015 21:13:35 -0400

fix alignment for structs on the stack

Diffstat:
Mlisc/isel.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisc/isel.c b/lisc/isel.c @@ -492,7 +492,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1) if ((--a)->inmem) { assert(a->align <= 4); stk += a->size; - if (a->align == 4) + if (a->align == 4) /* todo, bigger alignments */ stk += stk & 15; } stk += stk & 15; @@ -537,7 +537,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1) if (!a->inmem) continue; sz = a->size; - if (a->align == 4 && stk % 16) + if (a->align == 4 && (stk-sz) % 16) sz += 8; stk -= sz; if (i->op == OArgc) {