mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 14:10:32 +02:00
* compilation of x86_64-win64 fixed
This commit is contained in:
parent
cbc2d0351c
commit
49af134ba7
@ -369,26 +369,20 @@ unit cgcpu;
|
||||
r : longint;
|
||||
regs_to_save_mm: tcpuregisterarray;
|
||||
begin
|
||||
{ if a subroutine is marked as non-returning, we do
|
||||
not generate any exit code, so we really trust the noreturn directive
|
||||
{ we do not need an exit stack frame when we never return
|
||||
* the final ret is left so the peephole optimizer can easily do call/ret -> jmp or call conversions
|
||||
* the entry stack frame must be normally generated because the subroutine could be still left by
|
||||
an exception and then the unwinding code might need to restore the registers stored by the entry code
|
||||
}
|
||||
if po_noreturn in current_procinfo.procdef.procoptions then
|
||||
exit;
|
||||
|
||||
if not(po_noreturn in current_procinfo.procdef.procoptions) then
|
||||
begin
|
||||
regs_to_save_mm:=paramanager.get_saved_registers_mm(current_procinfo.procdef.proccalloption);
|
||||
{ Prevent return address from a possible call from ending up in the epilogue }
|
||||
{ (restoring registers happens before epilogue, providing necessary padding) }
|
||||
if (current_procinfo.flags*[pi_has_unwind_info,pi_do_call,pi_has_saved_regs])=[pi_has_unwind_info,pi_do_call] then
|
||||
list.concat(Taicpu.op_none(A_NOP));
|
||||
{ remove stackframe }
|
||||
if not(nostackframe) and
|
||||
{ we do not need an exit stack frame when we never return
|
||||
|
||||
* the final ret is left so the peephole optimizer can easily do call/ret -> jmp or call conversions
|
||||
* the entry stack frame must be normally generated because the subroutine could be still left by
|
||||
an exception and then the unwinding code might need to restore the registers stored by the entry code
|
||||
}
|
||||
not(po_noreturn in current_procinfo.procdef.procoptions) then
|
||||
if not(nostackframe) then
|
||||
begin
|
||||
if use_push then
|
||||
begin
|
||||
@ -431,6 +425,7 @@ unit cgcpu;
|
||||
|
||||
if pi_uses_ymm in current_procinfo.flags then
|
||||
list.Concat(taicpu.op_none(A_VZEROUPPER));
|
||||
end;
|
||||
|
||||
list.concat(Taicpu.Op_none(A_RET,S_NO));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user