From be1b6ba7b7175eeb0bd2f8713dee8f7a0d0ba4e9 Mon Sep 17 00:00:00 2001 From: grischka Date: Tue, 30 Apr 2013 00:33:34 +0200 Subject: avoid "decl after statement" please for compiling tcc with msc --- x86_64-gen.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'x86_64-gen.c') diff --git a/x86_64-gen.c b/x86_64-gen.c index 24fa2c6..2788677 100644 --- a/x86_64-gen.c +++ b/x86_64-gen.c @@ -664,9 +664,10 @@ void gen_offs_sp(int b, int r, int d) } /* Return 1 if this function returns via an sret pointer, 0 otherwise */ -ST_FUNC int gfunc_sret(CType *vt, CType *ret, int *ret_align) { - *ret_align = 1; // Never have to re-align return values for x86-64 +ST_FUNC int gfunc_sret(CType *vt, CType *ret, int *ret_align) +{ int size, align; + *ret_align = 1; // Never have to re-align return values for x86-64 size = type_size(vt, &align); ret->ref = NULL; if (size > 8) { @@ -687,9 +688,9 @@ ST_FUNC int gfunc_sret(CType *vt, CType *ret, int *ret_align) { } int gfunc_arg_size(CType *type) { + int align; if (type->t & (VT_ARRAY|VT_BITFIELD)) return 8; - int align; return type_size(type, &align); } @@ -706,9 +707,10 @@ void gfunc_call(int nb_args) So, we process arguments which will be passed by stack first. */ struct_size = args_size; for(i = 0; i < nb_args; i++) { - --arg; + SValue *sv; - SValue *sv = &vtop[-i]; + --arg; + sv = &vtop[-i]; bt = (sv->type.t & VT_BTYPE); size = gfunc_arg_size(&sv->type); @@ -2025,8 +2027,9 @@ void gen_cvt_ftof(int t) vtop->r = TREG_ST0; } } else { + int r; gv(RC_ST0); - int r = get_reg(RC_FLOAT); + r = get_reg(RC_FLOAT); if (tbt == VT_DOUBLE) { o(0xf0245cdd); /* fstpl -0x10(%rsp) */ /* movsd -0x10(%rsp),%xmm0 */ -- cgit v1.3.1