[PATCH] D49055: [compiler-rt] [builtins] Implement the __chkstk function for ARM for MinGW

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 9 14:46:32 PDT 2018


mstorsjo added a comment.

In https://reviews.llvm.org/D49055#1156485, @smeenai wrote:

> Microsoft's implementation also checks the stack allocation against the thread's stack limit. Do you care about doing that?


That might be neat to do, but we don't do that in the existing implementations of __chkstk* for x86, nor in the aarch64 version I wrote a few months ago (where I justified it to myself with the same reason; it hasn't been done for x86 yet either).



================
Comment at: lib/builtins/arm/chkstk.S:10
+
+// This clobbers the register r12, and uses r5 and r6 as temporaries
+// by backing them up and restoring them afterwards.
----------------
smeenai wrote:
> It also clobbers the condition codes. We were bitten by this before; see https://reviews.llvm.org/rL311061.
Good catch, I'll amend the comment for clarity.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49055





More information about the llvm-commits mailing list