From d6d7686b608c4b7cd88877b30579ca2346e5d284 Mon Sep 17 00:00:00 2001 From: grischka Date: Fri, 8 Feb 2013 19:07:11 +0100 Subject: tcc.h: declare CValue.tab[LDOUBLE_SIZE/4] Should fix some warnings wrt. access out of array bounds. tccelf.c: fix "static function unused" warning x86_64-gen.c: fix "ctype.ref uninitialzed" warning and cleanup tcc-win32.txt: remove obsolete limitation notes. --- arm-gen.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'arm-gen.c') diff --git a/arm-gen.c b/arm-gen.c index 8dc6691..6981395 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -106,15 +106,6 @@ enum { are directly pushed on stack. */ //#define FUNC_STRUCT_PARAM_AS_PTR -#if defined(TCC_ARM_EABI) && defined(TCC_ARM_VFP) -ST_DATA CType float_type, double_type, func_float_type, func_double_type; -#define func_ldouble_type func_double_type -#else -#define func_float_type func_old_type -#define func_double_type func_old_type -#define func_ldouble_type func_old_type -#endif - /* pointer size, in bytes */ #define PTR_SIZE 4 @@ -175,14 +166,27 @@ ST_DATA const int reg_classes[NB_REGS] = { #endif }; -/* keep in sync with line 104 above */ -#if defined(TCC_ARM_EABI) && defined(TCC_ARM_VFP) -ST_DATA CType float_type, double_type, func_float_type, func_double_type; -#endif - static int func_sub_sp_offset, last_itod_magic; static int leaffunc; +#if defined(TCC_ARM_EABI) && defined(TCC_ARM_VFP) +static CType float_type, double_type, func_float_type, func_double_type; +ST_FUNC void arm_init_types(void) +{ + float_type.t = VT_FLOAT; + double_type.t = VT_DOUBLE; + func_float_type.t = VT_FUNC; + func_float_type.ref = sym_push(SYM_FIELD, &float_type, FUNC_CDECL, FUNC_OLD); + func_double_type.t = VT_FUNC; + func_double_type.ref = sym_push(SYM_FIELD, &double_type, FUNC_CDECL, FUNC_OLD); +} +#else +#define func_float_type func_old_type +#define func_double_type func_old_type +#define func_ldouble_type func_old_type +ST_FUNC void arm_init_types(void) {} +#endif + static int two2mask(int a,int b) { return (reg_classes[a]|reg_classes[b])&~(RC_INT|RC_FLOAT); } -- cgit v1.3.1