[LLVMdev] Issue with X86FrameLowering __chkstk on Windows 8 64-bit / Visual Studio 2012

Kévin Szkudlapski szkudl.k at gmail.com
Sun Sep 1 12:37:37 PDT 2013

Hi Michael,

On Tue, Aug 27, 2013 at 5:18 AM, Michael Lewis <don.apoch at gmail.com> wrote:
> It's not a solution to the actual bug (which is, as the thread you linked
> discusses, a problem with the assumption on LLVM's part that the __chkstk
> function lies within 2GB of the emitted code's address space) but there is a
> simple workaround: hoist all allocas to the first basic block of your
> function. This allows the JIT to perform all stack allocations in a single
> adjustment of the SP instead of needing to use dynamic stack allocation, and
> thereby avoids the call to __chkstk entirely.
Thanks for you answer, I redesigned my code and it's look ok now.
However, I tried to insert a breakpoint at ``if (NumBytes >= 4096 &&
STI.isTargetCOFF() && !STI.isTargetEnvMacho())'' but the condition is
never met.

So I'm still wondering where, in LLVM, the call to __chkstk is
emitted. If anybody has an idea, please let me know. :)

Kevin Szkudlapski

More information about the llvm-dev mailing list