From f115c1234692364f3f097a416e4a6e21abf0cbf3 Mon Sep 17 00:00:00 2001 From: grischka Date: Sat, 6 Aug 2011 16:08:03 +0200 Subject: 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. --- tccgen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tccgen.c') 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; -- cgit v1.3.1