[clang] [Clang][Sema]:Fix musttail attribute on a function with not_tail_called attribute has no warning/error (PR #134465)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 9 12:46:05 PDT 2025
mizvekov wrote:
I agree that if we can't guarantee it will be tail-called, this must be an error.
must_tail is not an optimization.
In fact, LLVM by itself will already perform tail call optimizations, and remove them when it would not be profitable in terms of execution cost.
The point of must_tail is to support cases where the tail call is required for correctness, otherwise by ignoring it will lead to UB.
https://github.com/llvm/llvm-project/pull/134465
More information about the cfe-commits
mailing list