From 55ea6d3fc175b0e01e2e946ca9b319c1fbe8aa67 Mon Sep 17 00:00:00 2001 From: James Lyon Date: Fri, 19 Apr 2013 00:40:48 +0100 Subject: x86-64 ABI fixes. abitest now passes; however test1-3 fail in init_test. All other tests pass. I need to re-test Win32 and Linux-x86. I've added a dummy implementation of gfunc_sret to c67-gen.c so it should now compile, and I think it should behave as before I created gfunc_sret. --- tccgen.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tccgen.c') diff --git a/tccgen.c b/tccgen.c index febab11..83ee171 100644 --- a/tccgen.c +++ b/tccgen.c @@ -2495,21 +2495,29 @@ ST_FUNC void vstore(void) vtop[-1].r = t | VT_LVAL; } store(r, vtop - 1); -#ifndef TCC_TARGET_X86_64 - /* two word case handling : store second register at word + 4 */ + /* two word case handling : store second register at word + 4 (or +8 for x86-64) */ +#ifdef TCC_TARGET_X86_64 + if ((ft & VT_BTYPE) == VT_QLONG) { +#else if ((ft & VT_BTYPE) == VT_LLONG) { +#endif vswap(); /* convert to int to increment easily */ +#ifdef TCC_TARGET_X86_64 + vtop->type.t = VT_LLONG; + gaddrof(); + vpushi(8); +#else vtop->type.t = VT_INT; gaddrof(); vpushi(4); +#endif gen_op('+'); vtop->r |= VT_LVAL; vswap(); /* XXX: it works because r2 is spilled last ! */ store(vtop->r2, vtop - 1); } -#endif } vswap(); vtop--; /* NOT vpop() because on x86 it would flush the fp stack */ -- cgit v1.3.1