PR8919 - LLVM incorrectly generates "_alloca" as the stack probing call. That
authorBill Wendling <isanbard@gmail.com>
Thu, 6 Jan 2011 00:50:34 +0000 (00:50 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 6 Jan 2011 00:50:34 +0000 (00:50 +0000)
works only on MinGW32. On 64-bit, the function to call is "__chkstk".
Patch by KS Sreeram!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122934 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86FrameInfo.cpp

index afadb4c9b3d34da79010c6f0da0f448f3f8ae9a5..5a8d9768f846396ded95c7d9db839f026bb91adf 100644 (file)
@@ -566,6 +566,8 @@ void X86FrameInfo::emitPrologue(MachineFunction &MF) const {
 
     const char *StackProbeSymbol =
       STI.isTargetWindows() ? "_chkstk" : "_alloca";
+    if (Is64Bit && STI.isTargetCygMing())
+      StackProbeSymbol = "__chkstk";
     unsigned CallOp = Is64Bit ? X86::CALL64pcrel32 : X86::CALLpcrel32;
     if (!isEAXAlive) {
       BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), X86::EAX)