diff --git a/x86/Machregs.v b/x86/Machregs.v index 2b6fc8ab5..fab90a99d 100644 --- a/x86/Machregs.v +++ b/x86/Machregs.v @@ -191,8 +191,15 @@ Definition destroyed_by_setstack (ty: typ): list mreg := | _ => nil end. +(** Calls to variadic functions set the AL register in the ELF ABI + and can copy FP arguments to the CX, DX, R8 and R9 registers in the Win64 ABI. + (See file Asmexpand.ml.) Mark those registers as destroyed, + so that the register containing the function address to call is preserved. *) + Definition destroyed_at_indirect_call: list mreg := - AX :: nil. + if Archi.win64 + then CX :: DX :: R8 :: R9 :: nil + else AX :: nil. Definition temp_for_parent_frame: mreg := AX.