[PATCH] D42292: [ARM] Call __chkstk for dynamic stack allocation in all windows environments

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 11:51:51 PST 2018


mstorsjo added a comment.

In https://reviews.llvm.org/D42292#982042, @compnerd wrote:

> What is the motivation for this change?  If you are trying to enable this for MinGW, that is fine, but I'm not sure if we should try to catch the VLA issues in the frontend.  I believe that on x86_64, we also disallow the VLAs as Microsoft does not permit them there, but @rnk can correct me if I'm wrong on that.


I'm trying to enable it both for MinGW and for MSVC. I'm not interested in the case of VLAs though, only for the alloca() function. On the clang level, both are lowered to the same LLVM alloca intrinsic function. to match MSVC better, perhaps clang should reject VLAs on that level if acting in MSVC mode - currently it doesn't. And the current code in LLVM (that I'm changing here) doesn't do much to "disable" VLAs for MSVC - it just lowers them into a normal stack decrement, which would compile just fine, but possibly lead to spurious runtime crashes instead.


https://reviews.llvm.org/D42292





More information about the llvm-commits mailing list