* [PATCH] xtensa: Enforce return address saving when -Og is specified
[not found] <ffa22cd6-978c-0f23-d2ff-c52000db3398.ref@yahoo.co.jp>
@ 2023-02-18 4:54 ` Takayuki 'January June' Suwa
2023-02-21 1:34 ` Max Filippov
0 siblings, 1 reply; 2+ messages in thread
From: Takayuki 'January June' Suwa @ 2023-02-18 4:54 UTC (permalink / raw)
To: GCC Patches; +Cc: Max Filippov
Leaf function often omits saving its return address to the stack slot,
and this feature often makes debugging very confusing, especially for
stack dump analysis.
gcc/ChangeLog:
* config/xtensa/xtensa.cc (xtensa_call_save_reg): Change to return
true if register A0 (return address register) when -Og is specified.
---
gcc/config/xtensa/xtensa.cc | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc
index d987f1dfede..1d9e4d1561a 100644
--- a/gcc/config/xtensa/xtensa.cc
+++ b/gcc/config/xtensa/xtensa.cc
@@ -3224,8 +3224,11 @@ xtensa_call_save_reg (int regno)
return false;
if (regno == A0_REG)
- return crtl->profile || !crtl->is_leaf || crtl->calls_eh_return ||
- df_regs_ever_live_p (regno);
+ /* Ensure the return address to be saved to the stack slot in order
+ to assist stack dump analysis when -Og is specified. */
+ return optimize_debug
+ || crtl->profile || !crtl->is_leaf || crtl->calls_eh_return
+ || df_regs_ever_live_p (regno);
if (crtl->calls_eh_return && IN_RANGE (regno, 2, 3))
return true;
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] xtensa: Enforce return address saving when -Og is specified
2023-02-18 4:54 ` [PATCH] xtensa: Enforce return address saving when -Og is specified Takayuki 'January June' Suwa
@ 2023-02-21 1:34 ` Max Filippov
0 siblings, 0 replies; 2+ messages in thread
From: Max Filippov @ 2023-02-21 1:34 UTC (permalink / raw)
To: Takayuki 'January June' Suwa; +Cc: GCC Patches
On Fri, Feb 17, 2023 at 8:54 PM Takayuki 'January June' Suwa
<jjsuwa_sys3175@yahoo.co.jp> wrote:
>
> Leaf function often omits saving its return address to the stack slot,
> and this feature often makes debugging very confusing, especially for
> stack dump analysis.
>
> gcc/ChangeLog:
>
> * config/xtensa/xtensa.cc (xtensa_call_save_reg): Change to return
> true if register A0 (return address register) when -Og is specified.
> ---
> gcc/config/xtensa/xtensa.cc | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Regtested for target=xtensa-linux-uclibc, no new regressions.
Committed to master.
--
Thanks.
-- Max
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-21 1:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <ffa22cd6-978c-0f23-d2ff-c52000db3398.ref@yahoo.co.jp>
2023-02-18 4:54 ` [PATCH] xtensa: Enforce return address saving when -Og is specified Takayuki 'January June' Suwa
2023-02-21 1:34 ` Max Filippov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).