Skip to content

Commit 90ae383

Browse files
committed
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.
1 parent af1cfd9 commit 90ae383

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

i386-gen.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ ST_FUNC void gfunc_call(int nb_args)
409409
args_size = 0;
410410
for(i = 0;i < nb_args; i++) {
411411
if ((vtop->type.t & VT_BTYPE) == VT_STRUCT) {
412-
/* fetch cpu flag before generating any code */
413-
if ((vtop->r & VT_VALMASK) == VT_CMP)
414-
gv(RC_INT);
412+
/* fetch cpu flag before generating any code */
413+
if ((vtop->r & VT_VALMASK) == VT_CMP)
414+
gv(RC_INT);
415415
size = type_size(&vtop->type, &align);
416416
/* align to stack align size */
417417
size = (size + 3) & ~3;

x86_64-gen.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,10 @@ void gfunc_call(int nb_args)
828828
continue; /* arguments smaller than 8 bytes passed in registers or on stack */
829829

830830
if (bt == VT_STRUCT) {
831-
/* fetch cpu flag before generating any code */
832-
if ((vtop->r & VT_VALMASK) == VT_CMP)
833-
gv(RC_INT);
834-
/* align to stack align size */
831+
/* fetch cpu flag before generating any code */
832+
if ((vtop->r & VT_VALMASK) == VT_CMP)
833+
gv(RC_INT);
834+
/* align to stack align size */
835835
size = (size + 15) & ~15;
836836
/* generate structure store */
837837
r = get_reg(RC_INT);

0 commit comments

Comments
 (0)