From e647c3137d91f5daa1096b21e09d689ddf71335b Mon Sep 17 00:00:00 2001 From: jiang <30155751@qq.com> Date: Fri, 2 May 2014 23:45:48 +0800 Subject: Fix x86-64 vla For example, it should look like this High stack ------------- ----- Func_ret_sub ------------ ---- Vla stack ------------- ---- Known loc -------------- Low Increased loc_stack () function is used for temporary stack management, call save_reg (), released by load () Like this Before use High ----- Known loc ---- --- ---- ---- Pop_stack Low loc_stack (size, 1) After use High ----- Known loc ---- Pop_stack --- ---- ---- Low --- tcc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index 266b43a..f56273f 100644 --- a/tcc.h +++ b/tcc.h @@ -761,7 +761,7 @@ struct TCCState { #define VT_LVAL_TYPE (VT_LVAL_BYTE | VT_LVAL_SHORT | VT_LVAL_UNSIGNED) #define VT_BOUNDED 0x8000 /* value is bounded. The address of the bounding function call point is in vc */ -#define VT_TMP 0x10000 +#define VT_TMP 0x10000 /* luck or tmp stack */ /* types */ #define VT_BTYPE 0x000f /* mask for basic type */ @@ -1212,6 +1212,7 @@ ST_FUNC int ieee_finite(double d); ST_FUNC void test_lvalue(void); ST_FUNC void swap(int *p, int *q); ST_FUNC void vpushi(int v); +ST_FUNC void vpushs(addr_t v); ST_FUNC Sym *external_global_sym(int v, CType *type, int r); ST_FUNC void vset(CType *type, int r, int v); ST_FUNC void vswap(void); @@ -1247,6 +1248,7 @@ ST_FUNC void gen_inline_functions(void); ST_FUNC void decl(int l); ST_FUNC void vdup(void); ST_FUNC void gaddrof(void); +ST_FUNC int loc_stack(int size, int is_sub); #if defined CONFIG_TCC_BCHECK || defined TCC_TARGET_C67 ST_FUNC Sym *get_sym_ref(CType *type, Section *sec, unsigned long offset, unsigned long size); #endif -- cgit v1.3.1