aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tcc.h17
-rw-r--r--tccgen.c6
2 files changed, 13 insertions, 10 deletions
diff --git a/tcc.h b/tcc.h
index 6e9b01f..b0c516c 100644
--- a/tcc.h
+++ b/tcc.h
@@ -631,14 +631,15 @@ struct TCCState {
};
/* The current value can be: */
-#define VT_VALMASK 0x001f
-#define VT_CONST 0x0010 /* constant in vc
+#define VT_VALMASK 0x003f
+#define VT_CONST 0x0030 /* constant in vc
(must be first non register value) */
-#define VT_LLOCAL 0x0011 /* lvalue, offset on stack */
-#define VT_LOCAL 0x0012 /* offset on stack */
-#define VT_CMP 0x0013 /* the value is stored in processor flags (in vc) */
-#define VT_JMP 0x0014 /* value is the consequence of jmp true (even) */
-#define VT_JMPI 0x0015 /* value is the consequence of jmp false (odd) */
+#define VT_LLOCAL 0x0031 /* lvalue, offset on stack */
+#define VT_LOCAL 0x0032 /* offset on stack */
+#define VT_CMP 0x0033 /* the value is stored in processor flags (in vc) */
+#define VT_JMP 0x0034 /* value is the consequence of jmp true (even) */
+#define VT_JMPI 0x0035 /* value is the consequence of jmp false (odd) */
+#define VT_REF 0x0040 /* value is pointer to structure rather than address */
#define VT_LVAL 0x0100 /* var is an lvalue */
#define VT_SYM 0x0200 /* a symbol value is added */
#define VT_MUSTCAST 0x0400 /* value must be casted to be correct (used for
@@ -652,8 +653,6 @@ struct TCCState {
#define VT_LVAL_UNSIGNED 0x4000 /* lvalue is unsigned */
#define VT_LVAL_TYPE (VT_LVAL_BYTE | VT_LVAL_SHORT | VT_LVAL_UNSIGNED)
-#define VT_REF 0x0020
-
/* types */
#define VT_INT 0 /* integer type */
#define VT_BYTE 1 /* signed byte type */
diff --git a/tccgen.c b/tccgen.c
index 2df5de5..c800acc 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -709,8 +709,12 @@ ST_FUNC int gv(int rc)
/* XXX: not portable yet */
#if defined(__i386__) || defined(__x86_64__)
/* Zero pad x87 tenbyte long doubles */
- if (size == LDOUBLE_SIZE)
+ if (size == LDOUBLE_SIZE) {
vtop->c.tab[2] &= 0xffff;
+#if LDOUBLE_SIZE == 16
+ vtop->c.tab[3] = 0;
+#endif
+ }
#endif
ptr = section_ptr_add(data_section, size);
size = size >> 2;