x86_64/i386: Add missing fetch CPU flag
In x86_64-gen.c/i386-gen.c, gfunc_call will generate structure store for bt == VT_STRUCT. Before generating any code, it is needed fetch cpu flag. As #ifdef TCC_TARGET_PE, gfunc_call() forgot to do this.
This commit is contained in:
parent
af1cfd9e82
commit
90ae383f62
2 changed files with 7 additions and 7 deletions
|
@ -409,9 +409,9 @@ ST_FUNC void gfunc_call(int nb_args)
|
||||||
args_size = 0;
|
args_size = 0;
|
||||||
for(i = 0;i < nb_args; i++) {
|
for(i = 0;i < nb_args; i++) {
|
||||||
if ((vtop->type.t & VT_BTYPE) == VT_STRUCT) {
|
if ((vtop->type.t & VT_BTYPE) == VT_STRUCT) {
|
||||||
/* fetch cpu flag before generating any code */
|
/* fetch cpu flag before generating any code */
|
||||||
if ((vtop->r & VT_VALMASK) == VT_CMP)
|
if ((vtop->r & VT_VALMASK) == VT_CMP)
|
||||||
gv(RC_INT);
|
gv(RC_INT);
|
||||||
size = type_size(&vtop->type, &align);
|
size = type_size(&vtop->type, &align);
|
||||||
/* align to stack align size */
|
/* align to stack align size */
|
||||||
size = (size + 3) & ~3;
|
size = (size + 3) & ~3;
|
||||||
|
|
|
@ -828,10 +828,10 @@ void gfunc_call(int nb_args)
|
||||||
continue; /* arguments smaller than 8 bytes passed in registers or on stack */
|
continue; /* arguments smaller than 8 bytes passed in registers or on stack */
|
||||||
|
|
||||||
if (bt == VT_STRUCT) {
|
if (bt == VT_STRUCT) {
|
||||||
/* fetch cpu flag before generating any code */
|
/* fetch cpu flag before generating any code */
|
||||||
if ((vtop->r & VT_VALMASK) == VT_CMP)
|
if ((vtop->r & VT_VALMASK) == VT_CMP)
|
||||||
gv(RC_INT);
|
gv(RC_INT);
|
||||||
/* align to stack align size */
|
/* align to stack align size */
|
||||||
size = (size + 15) & ~15;
|
size = (size + 15) & ~15;
|
||||||
/* generate structure store */
|
/* generate structure store */
|
||||||
r = get_reg(RC_INT);
|
r = get_reg(RC_INT);
|
||||||
|
|
Loading…
Add table
Reference in a new issue