x86-64 bug fix: Use stack with alignment just like 32bit environments.

tcc-xref
Shinichiro Hamaji 2009-04-02 01:46:44 +09:00 committed by grischka
parent 06fa15fb99
commit e6db5f5fb6
1 changed files with 4 additions and 5 deletions

9
tcc.c
View File

@ -4802,13 +4802,12 @@ void save_reg(int r)
r = p->r & VT_VALMASK;
/* store register in the stack */
type = &p->type;
#ifndef TCC_TARGET_X86_64
if ((p->r & VT_LVAL) ||
if ((p->r & VT_LVAL) ||
(!is_float(type->t) && (type->t & VT_BTYPE) != VT_LLONG))
type = &int_type;
#else
if (p->r & VT_LVAL)
#ifdef TCC_TARGET_X86_64
type = &char_pointer_type;
#else
type = &int_type;
#endif
size = type_size(type, &align);
loc = (loc - size) & -align;