Skip to content

Commit

Permalink
x64: doesn't set AL on systemv if the function isn't varargs
Browse files Browse the repository at this point in the history
  • Loading branch information
RealNeGate committed Oct 31, 2023
1 parent 1670f18 commit 5c7f188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tb/src/x64/x64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ static void isel(Ctx* restrict ctx, TB_Node* n, const int dst) {
SUBMIT(inst_move(target->dt, RAX, target_val));
} else {
// the number of float parameters is written into AL
if (is_sysv) {
if (proto->has_varargs && is_sysv) {
SUBMIT(inst_op_imm(MOV, TB_TYPE_I8, RAX, xmms_used));
ins[in_count++] = FIRST_GPR + RAX;
caller_saved_gprs &= ~(1ull << RAX);
Expand Down

0 comments on commit 5c7f188

Please sign in to comment.