aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/mcode/ortho_code-x86-emits.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/ortho/mcode/ortho_code-x86-emits.adb')
-rw-r--r--src/ortho/mcode/ortho_code-x86-emits.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ortho/mcode/ortho_code-x86-emits.adb b/src/ortho/mcode/ortho_code-x86-emits.adb
index 48aa745e6..70b1fb584 100644
--- a/src/ortho/mcode/ortho_code-x86-emits.adb
+++ b/src/ortho/mcode/ortho_code-x86-emits.adb
@@ -1641,9 +1641,13 @@ package body Ortho_Code.X86.Emits is
Gen_8 (Opc2_Grp1_And or 2#11_000_000# or To_Reg32 (Reg));
Gen_32 (not (X86.Flags.Stack_Boundary - 1));
End_Insn;
+ -- Call chkstk if needed.
+ -- On windows x32, chkstk probes the stack and allocate stack.
+ -- On windows x64, chkstk only probes the stack.
if X86.Flags.Flag_Alloca_Call then
Gen_Call (Chkstk_Symbol);
- else
+ end if;
+ if (not X86.Flags.Flag_Alloca_Call) or X86.Flags.Win64 then
-- subl esp, reg
Start_Insn;
Gen_Rex_B (Reg, Sz_Ptr);