This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[arm] Tweak FPA frame notes.
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Tue, 3 Aug 2004 15:19:34 +0100
- Subject: [arm] Tweak FPA frame notes.
- Organization: CodeSourcery
The patch below creates FPA store-multiple frame notes in the same format as
other store-multiple instructions.
Before the patch we emit
(parallel (set (mem (pre_dec ...)) (reg)) ...)
And afterwards
(sequence (set <sp> (plus <sp> <count*12>))
(set (mem (plus <sp> <constant>))) ...)
This simplifies future code to generate unwind directives, and removes a
redundant frame address adjustment in the existing output.
Tested by visually inspecting the resulting .debug_frame output.
Ok?
Paul
2004-08-03 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (emit_sfm): Only emit a single frame adjustment.
Index: arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.380
diff -u -p -r1.380 arm.c
--- arm.c 20 Jul 2004 23:21:15 -0000 1.380
+++ arm.c 3 Aug 2004 13:26:41 -0000
@@ -9911,7 +9937,7 @@ emit_sfm (int base_reg, int count)
int i;
par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
- dwarf = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+ dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (count + 1));
reg = gen_rtx_REG (XFmode, base_reg++);
@@ -9922,13 +9948,10 @@ emit_sfm (int base_reg, int count)
gen_rtx_UNSPEC (BLKmode,
gen_rtvec (1, reg),
UNSPEC_PUSH_MULT));
- tmp
- = gen_rtx_SET (VOIDmode,
- gen_rtx_MEM (XFmode,
- gen_rtx_PRE_DEC (BLKmode, stack_pointer_rtx)),
- reg);
+ tmp = gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (XFmode, stack_pointer_rtx), reg);
RTX_FRAME_RELATED_P (tmp) = 1;
- XVECEXP (dwarf, 0, count - 1) = tmp;
+ XVECEXP (dwarf, 0, 1) = tmp;
for (i = 1; i < count; i++)
{
@@ -9937,13 +9960,21 @@ emit_sfm (int base_reg, int count)
tmp = gen_rtx_SET (VOIDmode,
gen_rtx_MEM (XFmode,
- gen_rtx_PRE_DEC (BLKmode,
- stack_pointer_rtx)),
+ plus_constant (stack_pointer_rtx,
+ i * 12)),
reg);
RTX_FRAME_RELATED_P (tmp) = 1;
- XVECEXP (dwarf, 0, count - i - 1) = tmp;
+ XVECEXP (dwarf, 0, i + 1) = tmp;
}
+ tmp = gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ gen_rtx_PLUS (SImode,
+ stack_pointer_rtx,
+ GEN_INT (-12 * count)));
+ RTX_FRAME_RELATED_P (tmp) = 1;
+ XVECEXP (dwarf, 0, 0) = tmp;
+
par = emit_insn (par);
REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
REG_NOTES (par));