https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97831
Bug ID: 97831
Summary: Lack of disable_tail_calls attribute
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: irogers at google dot com
Target Milestone: ---
Tail call optimization may remove stack frames, certain tests assert stack
frames are present. Previously these tests would use
__attribute__((optimize("no-optimize-sibling-calls"))), however, the use of the
optimize attribute shouldn't occur in production code as per the FAQ:
https://gcc.gnu.org/wiki/FAQ#optimize_attribute_broken
The attribute disable_tail_calls is used in other compilers for this situation:
https://clang.llvm.org/docs/AttributeReference.html#disable-tail-calls
A situation where this has come up is in Linux:
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/