[PATCH] D43108: Support for the mno-stack-arg-probe flag

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 06:32:00 PST 2018


hans added a comment.

In https://reviews.llvm.org/D43108#1005904, @nruslan wrote:

> @hans: One real-world example is when it is used to compile UEFI code using PE/COFF targets natively. Obviously, UEFI uses ABI which is basically almost the same as MS ABI, except that chkstk is not used. It mostly works (I actually was able to get it running) except the cases when the code contains variable-sized arrays allocated on stacks. Unfortunately, stack-probe-size will only help with fixed sized array but will not help to solve the problem described in the bug description since stack usage is unknown at compile time. MinGW does not have this problem because it provides this flag.


I see, interesting. Might be worth mentioning in the commit message for others wondering what the flag is useful for.

> @MatzeB : there is a test on LLVM side (related review). Do you think the test is needed for clang side? If so, please let me know, what kind of test it is supposed to be.

Yes please, I think think there should be on in test/Driver/ to check that forwarding the flag to cc1 (and if we have a -mno-foo, there should maybe be a -mfoo variant too?), and a test in test/CodeGen/ to check that the attribute gets put on the functions correctly. Perhaps r321992 is a good example to look at.


Repository:
  rC Clang

https://reviews.llvm.org/D43108





More information about the cfe-commits mailing list