On Tue, Feb 27, 2024 at 09:54:45AM +0100, Richard Biener wrote: > Just to add we've in the past opted to avoid tail-calling abort () and friends > exactly to help debugging. So treating noreturn functions specially with > respect to caller saves looks inconsistent in this regard - it makes debugging > harder since a lot of info in the calling frame is going to be lost?
I know and am not very happy about the changes either. > I hope we at least avoid that at -O0, possibly also with -Og? r14-8495 fixed at least that. Of course, it can break debugging experience even when the noreturn function is compiled with -O2 but some or all callers of that are -O0 or -Og. So, if unlucky and e.g. abort function in glibc gets the no_callee_saved_registers treatment and actually uses some call saved registers, backtraces when something aborts will be worse or useless. And we don't even have any attribute which would tell gcc not to do that. So sure, another option is just revert the PR38534 changes. Jakub