From ef3d38c5c9d534099aae61651da3c3aa1ad3c6ab Mon Sep 17 00:00:00 2001 From: gus knight Date: Wed, 29 Jul 2015 16:57:41 -0400 Subject: Revert "fix-mixed-struct (patch by Pip Cet)" This reverts commit 4e04f67c94c97b4f28a4d73759a0ad38fb3a10f7. Requested by grischka. --- arm-gen.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'arm-gen.c') diff --git a/arm-gen.c b/arm-gen.c index 39185d2..a705073 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -34,8 +34,6 @@ #define NB_REGS 9 #endif -typedef int RegArgs; - #ifndef TCC_ARM_VERSION # define TCC_ARM_VERSION 5 #endif @@ -869,14 +867,9 @@ int floats_in_core_regs(SValue *sval) } } -ST_FUNC int regargs_nregs(RegArgs *args) -{ - return *args; -} - /* Return the number of registers needed to return the struct, or 0 if returning via struct pointer. */ -ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize, RegArgs *args) { +ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize) { #ifdef TCC_ARM_EABI int size, align; size = type_size(vt, &align); @@ -886,20 +879,18 @@ ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize = 8; ret->ref = NULL; ret->t = VT_DOUBLE; - *args = (size + 7) >> 3; + return (size + 7) >> 3; } else if (size <= 4) { *ret_align = 4; *regsize = 4; ret->ref = NULL; ret->t = VT_INT; - *args = 1; + return 1; } else - *args = 0; + return 0; #else - *args = 0; + return 0; #endif - - return *args != 0; } /* Parameters are classified according to how they are copied to their final @@ -1269,7 +1260,6 @@ void gfunc_prolog(CType *func_type) int n, nf, size, align, rs, struct_ret = 0; int addr, pn, sn; /* pn=core, sn=stack */ CType ret_type; - RegArgs dummy; #ifdef TCC_ARM_EABI struct avail_regs avregs = AVAIL_REGS_INITIALIZER; @@ -1281,7 +1271,7 @@ void gfunc_prolog(CType *func_type) n = nf = 0; if ((func_vt.t & VT_BTYPE) == VT_STRUCT && - !gfunc_sret(&func_vt, func_var, &ret_type, &align, &rs, &dummy)) + !gfunc_sret(&func_vt, func_var, &ret_type, &align, &rs)) { n++; struct_ret = 1; -- cgit v1.3.1