r177819 - Make clang to mark static stack allocations with lifetime markers to enable a more aggressive stack coloring.

Nadav Rotem nrotem at apple.com
Mon Mar 25 12:42:17 PDT 2013


On Mar 25, 2013, at 12:23 PM, Alexey Samsonov <samsonov at google.com> wrote:

> Cool you guys are working on it! I have a raw local patch that does the same (emits llvm.lifetime start/end intrinsics), and
> I hope to provide some feedback tomorrow, when I look at this commit in more details. Some of my concerns:
> 1) Rafael mentioned a thread where I asked about llvm.lifetime intrinsics semantics and behavior - you may be
> interested in it. I think we may resurrect it and clarify their semantics.
> 2) I'm afraid that immediate enabling of stack coloring may break things - I've seen that similar gcc option
> had to be disabled on some codebases because of the bugs in the code where a local variable was used after
> it went out of scope.

The Stack-Coloring pass detects undefined behavior such as the one that you mentioned and aborts the optimization. It has a command line flag that allows it to assert and crash on debug builds in order to debug the compiler itself. 

> 3) I actually want to emit lifetime.start/end intrinsics in one of AddressSanitizer modes (to implement -fsanitize=use-after-scope
> option) to reliably detect bugs in (2).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130325/aed36829/attachment.html>


More information about the cfe-commits mailing list