* Paul Koning: >> On Sep 21, 2018, at 2:17 PM, Florian Weimer <fwei...@redhat.com> wrote: >> >> * Segher Boessenkool: >> >>> On Fri, Sep 21, 2018 at 12:59:27PM +0200, Florian Weimer wrote: >>>> 2018-09-21 Florian Weimer <fwei...@redhat.com> >>>> >>>> PR middle-end/81035 >>>> * doc/extend.texi (Common Function Attributes): Mention that >>>> noreturn suppresses tail call optimization. >>> >>>> +In order to preserve backtraces, GCC will never turn calls to >>>> +@code{noreturn} functions into tail calls. >>> >>> Should we document this? Shouldn't we fix it, instead? >> >> Fix how? What is currently broken? >> >> For things like assertion failures, we do not want to replace the >> current stack frame with that of __assert_fail, I think. > > I agree. Also, tailcalls are optimizations. Speed optimizing > noreturn calls is obviously not interesting. Calls to noreturn > functions are short, and turning them into a jump probably makes no > difference in size, or if it does, not enough to matter.
The example in the bug report shows that tail calls can avoid setting up a stack frame, leading to smaller code size and CFI. Thanks, Florian