public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-8462] riscv: xtheadmempair: Fix CFA reg notes
@ 2024-03-18 8:03 Christoph Mテシllner
0 siblings, 0 replies; only message in thread
From: Christoph Mテシllner @ 2024-03-18 8:03 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d9d51e0552693bf1bcf6f23d53d058d60d72416e
commit r13-8462-gd9d51e0552693bf1bcf6f23d53d058d60d72416e
Author: Christoph Müllner <christoph.muellner@vrull.eu>
Date: Mon Apr 24 23:09:06 2023 +0200
riscv: xtheadmempair: Fix CFA reg notes
The current implementation triggers an assertion in
dwarf2out_frame_debug_cfa_offset() under certain circumstances.
The standard code uses REG_FRAME_RELATED_EXPR notes instead
of REG_CFA_OFFSET notes when saving registers on the stack.
So let's do this as well.
gcc/ChangeLog:
PR target/114160
* config/riscv/thead.cc (th_mempair_save_regs):
Emit REG_FRAME_RELATED_EXPR notes in prologue.
(cherry picked from commit 93973e4c5d3bcde1f84cad3b42a8c36e23900d19)
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Diff:
---
gcc/config/riscv/thead.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gcc/config/riscv/thead.cc b/gcc/config/riscv/thead.cc
index 75203805310..d7e3cf80d9b 100644
--- a/gcc/config/riscv/thead.cc
+++ b/gcc/config/riscv/thead.cc
@@ -368,8 +368,12 @@ th_mempair_save_regs (rtx operands[4])
rtx set2 = gen_rtx_SET (operands[2], operands[3]);
rtx insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set1, set2)));
RTX_FRAME_RELATED_P (insn) = 1;
- add_reg_note (insn, REG_CFA_OFFSET, copy_rtx (set1));
- add_reg_note (insn, REG_CFA_OFFSET, copy_rtx (set2));
+
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ copy_rtx (set1), REG_NOTES (insn));
+
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ copy_rtx (set2), REG_NOTES (insn));
}
/* Similar like riscv_restore_reg, but restores two registers from memory
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-18 8:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 8:03 [gcc r13-8462] riscv: xtheadmempair: Fix CFA reg notes Christoph Mテシllner
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).