[PATCH] D19001: [ppc64] Disable sibling-call-optimization when building tsan library by clang

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 11:33:27 PDT 2016


hfinkel added a comment.

In http://reviews.llvm.org/D19001#398177, @cycheng wrote:

> Hi Hal,
>
> Because I found that threshold is only workable for gcc, not for clang.
>
> If I build compiler-rt with clang, distance between __sanitizer_print_stack_trace and __tsan::PrintCurrentStackSlow is 0x2df8 = 11768
>
> So it looks like feasible work around is disable sco when building tsan library.
>
> (Run-time data when building compiler-rt by clang: https://llvm.org/bugs/show_bug.cgi?id=27280#c2)
>
> CY


As a general rule, I don't think it is acceptable to have a build-system dependency on an LLVM-level backend parameter. If this is something we need, then we need to add a Clang-level parameter for this. Alternatively, we might add an attribute applied to the function which must not be called as a tail call. On the other hand, before we consider that, is there a more-principled solution to actually fix this problem?

Looking at the code in BufferedStackTrace::LocatePcInTrace and MatchPc, the threshold used does not actually affect runtime, it is simply used to control matching variance. As a result, so long as it is not set large enough to pick up functions coming from other object files, it seems like setting a significantly-larger threshold would have have negative side-effect?


http://reviews.llvm.org/D19001





More information about the llvm-commits mailing list