[PATCH] D19148: Always inlining PrintCurrentStackSlow of tsan library to fix tail-call issue

Chuang-Yu Cheng via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 01:19:11 PDT 2016


cycheng added a comment.

In http://reviews.llvm.org/D19148#405951, @kcc wrote:

> Maybe you should instead inhibit the tail call optimization (by e.g. adding some dummy code after the call)?
>  Also, is a test possible for this change?


To inhibit tail call optimization, I tested something like this:

  int dummy() { volatile int i = 0; return i; }
  SANITIZER_INTERFACE_ATTRIBUTE
  void __sanitizer_print_stack_trace() {
    PrintCurrentStackSlow(StackTrace::GetCurrentPc());
    dummy();
  }

I thought maybe always inline is more simpler?


http://reviews.llvm.org/D19148





More information about the llvm-commits mailing list