-
Notifications
You must be signed in to change notification settings - Fork 13.5k
LLVM generated code crashes if stack frame > 4k on MinGW64 #9291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Applied r122934. |
We need to be extremely carefully here. __alloca and __chkstk have different semantics in general. Also, I believe mingw-w64 provided both __alloca and __chkstk. |
I have to reopen this. Sreeram's patch would be effective only on TDM. in http://tdm-gcc.tdragon.net/development
The symbol "__chkstk" is unique to tdm. gcc's cygwin.asm and mingw-w64-gcc (and I) assume "___chkstk". ps. see also bug 8777 ;) Anton,
We may prefer ___chkstk on win64 rather than __alloca. Or shall we implement our chkstk? :D |
However, I'd really prefer __alloca simply because we won't get into trouble if we'd try to link stuff with VCPP runtime, where __chkstk only probes the stack, but does not allocate it. |
MSVC has "__chkstk"(2 underscores) and cygming-w64 has "___chkstk" (3 underscores). I propose we may expand alloca(const) stuff to; addq $4096-8,%rsp I reminded now tdm-w64 has "__chkstk". ooooops! |
|
Excuse me, I intended below; loop to be expanded { Anyway it would be too far from practice :( |
I've investigated this issue further. Here is the full story: LLVM generated code was crashing with large stack frames. I inspected My initial testing was performed with TDM's GCC 4.5.1. After Mr.Takumi mentioned that mainline GCC was different from TDM's Later, I wanted to dig more into why LLVM's _alloca call didn't I compared the disassembly of _alloca/__chkstdk between TDM's GCC and For reference, I've included the disassembly of _alloca and __chkstk _alloca: __chkstk: |
Fixed in r128206. |
mentioned in issue llvm/llvm-bugzilla-archive#9100 |
[Swift LLDB support] Adapt to removal of IfConfigDecl
Extended Description
LLVM incorrectly generates "_alloca" as the stack probing call. That works only on MinGW32. On 64-bit, the function to call is "__chkstk". I've attached a patch to fix it.
The text was updated successfully, but these errors were encountered: