History

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.

kbkpbot committed 1 year ago

Commit 90ae3831 parent af1cfd92 files · +7 −7Browse files

Unified · Split

2 files
  1. i386-gen.c +3 −3
  2. x86_64-gen.c +4 −4
i386-gen.c+3−3
@@ -409,9 +409,9 @@ ST_FUNC void gfunc_call(int nb_args) · 408 unmodified lines
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
@@ -828,10 +828,10 @@ void gfunc_call(int nb_args) · 827 unmodified lines
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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t