From 8d90205fd933fbc8d36c935840d584a019a6be52 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Wed, 28 Nov 2012 22:13:02 +0100 Subject: [PATCH] Fix OABI calling convention OABI calling convention was broken since the addition of the hardfloat calling convention in commit 7f6095bfec82b178084b22b33941d4f06155e514. This commit fixes the breakage. --- arm-gen.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arm-gen.c b/arm-gen.c index aea07290..99f70cd6 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -829,7 +829,7 @@ void gfunc_call(int nb_args) --nb_args; } - vpushi(0); + vpushi(0), nb_args++; vtop->type.t = VT_LLONG; args_size = 0; #endif @@ -845,7 +845,7 @@ void gfunc_call(int nb_args) structures in the first zone are moved just after the SValue pointed by before_vfpreg_hfa. SValue's representing structures in the second zone are moved just after the SValue pointer by before_stack. */ - for(i = nb_args + 1 ; i-- ;) { + for(i = nb_args; i-- ;) { int j, assigned_vfpreg = 0; size = type_size(&vtop[-i].type, &align); switch(vtop[-i].type.t & VT_BTYPE) { @@ -920,9 +920,11 @@ void gfunc_call(int nb_args) } continue; default: +#ifdef TCC_ARM_EABI if (!i) { break; } +#endif if (ncrn < 4) { int is_long = (vtop[-i].type.t & VT_BTYPE) == VT_LLONG; @@ -953,7 +955,9 @@ void gfunc_call(int nb_args) #endif args_size += (size + 3) & -4; } - vtop--; +#ifdef TCC_ARM_EABI + vtop--, nb_args--; +#endif args_size = keep = 0; for(i = 0;i < nb_args; i++) { vrotb(keep+1); -- 2.11.4.GIT