forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NOT-FOR-UPSTREAM] the default riscv arch of gcc to reflect this
Signed-off-by: Han Gao <[email protected]>
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
toolchain/gcc/patches-13.x/999-riscv-xtheadmempair-Fix-CFA-reg-notes.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From cded6457c839e09940f795c44277ae7cae82d5ca Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Christoph=20M=C3=BCllner?= <[email protected]> | ||
Date: Mon, 24 Apr 2023 23:09:06 +0200 | ||
Subject: [PATCH] riscv: xtheadmempair: Fix CFA reg notes | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
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: | ||
|
||
* config/riscv/thead.cc (th_mempair_save_regs): | ||
Emit REG_FRAME_RELATED_EXPR notes in prologue. | ||
|
||
Signed-off-by: Christoph Müllner <[email protected]> | ||
--- | ||
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 | ||
-- | ||
2.39.2 | ||
|