From bad74e6dce897df9f21cea5bf0a32df298856351 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Sep 2015 18:06:53 -0400 Subject: emit stack fixup only when necessary --- lisc/isel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisc/isel.c') diff --git a/lisc/isel.c b/lisc/isel.c index 6d15488..6928a1a 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -500,11 +500,13 @@ selcall(Fn *fn, Ins *i0, Ins *i1) if (rtype(i1->arg[1]) == RTyp) diag("struct-returning function not implemented"); + if (stk) { + r = newcon(-(int64_t)stk, fn); + emit(OSAlloc, 0, R, r, R); + } for (n=0; n<8; n++) emit(OCopy, 0, R, TMP(ireg[n]), R); emit(OCopy, i1->wide, i1->to, TMP(RAX), R); - r = newcon(-(int64_t)stk, fn); - emit(OSAlloc, 0, R, r, R); emit(OCall, 0, R, i->arg[0], R); emit(OCopy, 1, TMP(RAX), R, R); for (n=6-nint; n<8; n++) -- cgit 1.4.1