aboutsummaryrefslogtreecommitdiff
path: root/arm-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2013-02-08 19:07:11 +0100
committergrischka <grischka>2013-02-08 19:07:11 +0100
commitd6d7686b608c4b7cd88877b30579ca2346e5d284 (patch)
treec2618200601bfaa35f8ebba145bc4d16f9de71ac /arm-gen.c
parent4b8e7f1f39341fbff0a3f1162378ae57fba337e2 (diff)
downloadtinycc-d6d7686b608c4b7cd88877b30579ca2346e5d284.tar.gz
tinycc-d6d7686b608c4b7cd88877b30579ca2346e5d284.tar.bz2
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.
Diffstat (limited to 'arm-gen.c')
-rw-r--r--arm-gen.c32
1 files changed, 18 insertions, 14 deletions
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);
}