x86-64: fix flags and zero-pad long doubles

This fixes a bug introduced in commit
    8d107d9ffd
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.
This commit is contained in:
grischka
2011-08-06 16:08:03 +02:00
parent 81cd0cf6fd
commit f115c12346
2 changed files with 13 additions and 10 deletions

View File

@ -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;