Re: [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-29 Thread Michael Matz
Hello, On Tue, 27 Feb 2024, Jakub Jelinek wrote: > On Tue, Feb 27, 2024 at 10:13:14AM +0100, Jakub Jelinek wrote: > > For __libc_start_main, glibc surely just could use no_callee_saved_registers > > attribute, because that is typically the outermost frame in backtrace, > > there is no need to

Re: [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-27 Thread Jakub Jelinek
On Tue, Feb 27, 2024 at 10:13:14AM +0100, Jakub Jelinek wrote: > For __libc_start_main, glibc surely just could use no_callee_saved_registers > attribute, because that is typically the outermost frame in backtrace, > there is no need to save those there. > And for kernel if it really wants it and

Re: [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-27 Thread Jakub Jelinek
On Tue, Feb 27, 2024 at 10:13:14AM +0100, Jakub Jelinek wrote: > On Tue, Feb 27, 2024 at 10:04:06AM +0100, Jakub Jelinek wrote: > > > 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

Re: [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-27 Thread Richard Biener
On Tue, Feb 27, 2024 at 10:13 AM Jakub Jelinek wrote: > > On Tue, Feb 27, 2024 at 10:04:06AM +0100, Jakub Jelinek wrote: > > > 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

Re: [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-27 Thread Jakub Jelinek
On Tue, Feb 27, 2024 at 10:04:06AM +0100, Jakub Jelinek wrote: > > 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

Re: [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-27 Thread Jakub Jelinek
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

Re: [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-27 Thread Richard Biener
On Tue, Feb 27, 2024 at 9:42 AM Jakub Jelinek wrote: > > Hi! > > As mentioned in the PR, on x86_64 currently a lot of ICEs end up > with crashes in the unwinder like: > during RTL pass: expand > pr114044-2.c: In function ‘foo’: > pr114044-2.c:5:3: internal compiler error: in expand_fn_using_insn,

[PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116]

2024-02-27 Thread Jakub Jelinek
Hi! As mentioned in the PR, on x86_64 currently a lot of ICEs end up with crashes in the unwinder like: during RTL pass: expand pr114044-2.c: In function ‘foo’: pr114044-2.c:5:3: internal compiler error: in expand_fn_using_insn, at internal-fn.cc:208 5 | __builtin_clzg (a); |