[PATCH] D147714: [Attr] Introduce [[clang::nonportable_musttail]] as less strict version of [[clang::musttail]]

Josh Haberman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 11:03:43 PDT 2023


haberman added a comment.

> is a [[should_tail]] attribute sort of thing: a tail-hint where we do 'best effort with no promises', and make no guarantees that we're going to tail it.

I'm not sure I see the value in that. The compiler already optimizes tail calls when it can in a best-effort manner. The purpose of `[[musttail]]` is to support algorithms that would blow the stack if tail calls were not optimized. It's better to get a compiler error than to get a stack overflow at runtime (especially if stack overflow only occurs with certain inputs).


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

https://reviews.llvm.org/D147714



More information about the cfe-commits mailing list