nickdesaulniers wrote:

> Does anyone understand why Linux uses __builtin_return_address there? 

Grep turns up 257 callers of `__builtin_return_address` in the linux kernel 
sources. Hard to say definitely for all cases.  It's possible that some are 
incorrect, or should have their callers explicitly marked `always_inline` or 
`noinline`.

> Have we consider the alternative of just disabling inlining when a function 
> uses __builtin_return_address?

Is that what GCC does ([Looks like no](https://godbolt.org/z/8zKfGKrzq))?  
Perhaps useful to match behavior of this compiler builtin, if so.  Or document 
ways in which we intentionally diverge.

> Is there any case in Linux where it's a correctness issue to use a caller's 
> address?

257 call sites. hard to say

https://github.com/llvm/llvm-project/pull/82966
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to