[PATCH] D61665: [TailCall] Disable tail call if the callee function contain __builtin_frame_address or __builtin_return_address

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 05:16:32 PDT 2019


shiva0217 added a comment.

In D61665#1494592 <https://reviews.llvm.org/D61665#1494592>, @asb wrote:

> The description of the llvm.frameaddress and llvm.returnaddress intrinsics seems to indicate that these are "best effort" and LLVM doesn't really guarantee a correct result for a depth > 1 https://llvm.org/docs/LangRef.html#llvm-returnaddress-intrinsic https://llvm.org/docs/LangRef.html#llvm-returnaddress-intrinsic
>
> Is there a particular use case that is improved by improving the quality of frameaddress/returnaddress results?


Hi Alex,
There is a test case gcc/testsuite/gcc.c-torture/execute/20010122-1.c in gcc testsuite. GCC will not generate tail call and can get the correct builtin function results for depth > 0 in this case.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61665/new/

https://reviews.llvm.org/D61665





More information about the llvm-commits mailing list