aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2011-08-06 16:08:03 +0200
committergrischka <grischka>2011-08-06 16:11:56 +0200
commitf115c1234692364f3f097a416e4a6e21abf0cbf3 (patch)
treede821f5bdb8b1dafa4bf42070fb170e2d73998e1 /tccgen.c
parent81cd0cf6fdcbdd1d38c1a9f317d04fdac287a1e5 (diff)
downloadtinycc-f115c1234692364f3f097a416e4a6e21abf0cbf3.tar.gz
tinycc-f115c1234692364f3f097a416e4a6e21abf0cbf3.tar.bz2
x86-64: fix flags and zero-pad long doubles
This fixes a bug introduced in commit 8d107d9ffd8126d82b1c56be47431a6bcef39f08 that produced wrong code because of interference between 0x10 bits VT_CONST and x86_64-gen.c:TREG_MEM Also fully zero-pad long doubles on x86-64 to avoid random bytes in output files which disturb file comparison.
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c6
1 files changed, 5 insertions, 1 deletions
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;