Commit 2b8088e7 by Chung-Lin Tang Committed by Chung-Lin Tang

sh.c (output_stack_adjust): Remove !epilogue_p condition for generating…

sh.c (output_stack_adjust): Remove !epilogue_p condition for generating REG_FRAME_RELATED_EXPR note.

2012-06-12  Chung-Lin Tang  <cltang@codesourcery.com>

	* config/sh/sh.c (output_stack_adjust): Remove !epilogue_p
	condition for generating REG_FRAME_RELATED_EXPR note.
	(pop): Add code for generating REG_CFA_RESTORE,
	REG_CFA_ADJUST_CFA notes. Set RTX_FRAME_RELATED_P to 1.
	(sh_expand_epilogue): Use frame_insn() for FP to SP move.
	Set 'frame_p' of calls to output_stack_adjust() to 'true'.

From-SVN: r188424
parent 91fe5efb
2012-06-12 Chung-Lin Tang <cltang@codesourcery.com>
* config/sh/sh.c (output_stack_adjust): Remove !epilogue_p
condition for generating REG_FRAME_RELATED_EXPR note.
(pop): Add code for generating REG_CFA_RESTORE,
REG_CFA_ADJUST_CFA notes. Set RTX_FRAME_RELATED_P to 1.
(sh_expand_epilogue): Use frame_insn() for FP to SP move.
Set 'frame_p' of calls to output_stack_adjust() to 'true'.
2012-06-11 Richard Henderson <rth@redhat.com> 2012-06-11 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (HWI_HEX2): Add missing shift. * config/alpha/alpha.c (HWI_HEX2): Add missing shift.
......
...@@ -6483,7 +6483,6 @@ output_stack_adjust (int size, rtx reg, int epilogue_p, ...@@ -6483,7 +6483,6 @@ output_stack_adjust (int size, rtx reg, int epilogue_p,
emit_insn (GEN_MOV (const_reg, GEN_INT (size))); emit_insn (GEN_MOV (const_reg, GEN_INT (size)));
insn = emit_fn (GEN_ADD3 (reg, reg, const_reg)); insn = emit_fn (GEN_ADD3 (reg, reg, const_reg));
} }
if (! epilogue_p)
add_reg_note (insn, REG_FRAME_RELATED_EXPR, add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, reg, gen_rtx_SET (VOIDmode, reg,
gen_rtx_PLUS (SImode, reg, gen_rtx_PLUS (SImode, reg,
...@@ -6532,7 +6531,7 @@ push (int rn) ...@@ -6532,7 +6531,7 @@ push (int rn)
static void static void
pop (int rn) pop (int rn)
{ {
rtx x; rtx x, sp_reg, reg;
if (rn == FPUL_REG) if (rn == FPUL_REG)
x = gen_pop_fpul (); x = gen_pop_fpul ();
else if (rn == FPSCR_REG) else if (rn == FPSCR_REG)
...@@ -6550,7 +6549,18 @@ pop (int rn) ...@@ -6550,7 +6549,18 @@ pop (int rn)
x = gen_pop (gen_rtx_REG (SImode, rn)); x = gen_pop (gen_rtx_REG (SImode, rn));
x = emit_insn (x); x = emit_insn (x);
sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM);
reg = copy_rtx (GET_CODE (PATTERN (x)) == PARALLEL
? SET_DEST (XVECEXP (PATTERN (x), 0, 0))
: SET_DEST (PATTERN (x)));
add_reg_note (x, REG_CFA_RESTORE, reg);
add_reg_note (x, REG_CFA_ADJUST_CFA,
gen_rtx_SET (SImode, sp_reg,
plus_constant (SImode, sp_reg,
GET_MODE_SIZE (GET_MODE (reg)))));
add_reg_note (x, REG_INC, gen_rtx_REG (SImode, STACK_POINTER_REGNUM)); add_reg_note (x, REG_INC, gen_rtx_REG (SImode, STACK_POINTER_REGNUM));
RTX_FRAME_RELATED_P (x) = 1;
} }
/* Generate code to push the regs specified in the mask. */ /* Generate code to push the regs specified in the mask. */
...@@ -7433,14 +7443,14 @@ sh_expand_epilogue (bool sibcall_p) ...@@ -7433,14 +7443,14 @@ sh_expand_epilogue (bool sibcall_p)
See PR/18032 and PR/40313. */ See PR/18032 and PR/40313. */
emit_insn (gen_blockage ()); emit_insn (gen_blockage ());
output_stack_adjust (frame_size, hard_frame_pointer_rtx, e, output_stack_adjust (frame_size, hard_frame_pointer_rtx, e,
&live_regs_mask, false); &live_regs_mask, true);
/* We must avoid moving the stack pointer adjustment past code /* We must avoid moving the stack pointer adjustment past code
which reads from the local frame, else an interrupt could which reads from the local frame, else an interrupt could
occur after the SP adjustment and clobber data in the local occur after the SP adjustment and clobber data in the local
frame. */ frame. */
emit_insn (gen_blockage ()); emit_insn (gen_blockage ());
emit_insn (GEN_MOV (stack_pointer_rtx, hard_frame_pointer_rtx)); frame_insn (GEN_MOV (stack_pointer_rtx, hard_frame_pointer_rtx));
} }
else if (frame_size) else if (frame_size)
{ {
...@@ -7450,7 +7460,7 @@ sh_expand_epilogue (bool sibcall_p) ...@@ -7450,7 +7460,7 @@ sh_expand_epilogue (bool sibcall_p)
frame. */ frame. */
emit_insn (gen_blockage ()); emit_insn (gen_blockage ());
output_stack_adjust (frame_size, stack_pointer_rtx, e, output_stack_adjust (frame_size, stack_pointer_rtx, e,
&live_regs_mask, false); &live_regs_mask, true);
} }
if (SHMEDIA_REGS_STACK_ADJUST ()) if (SHMEDIA_REGS_STACK_ADJUST ())
...@@ -7667,7 +7677,7 @@ sh_expand_epilogue (bool sibcall_p) ...@@ -7667,7 +7677,7 @@ sh_expand_epilogue (bool sibcall_p)
output_stack_adjust (crtl->args.pretend_args_size output_stack_adjust (crtl->args.pretend_args_size
+ save_size + d_rounding + save_size + d_rounding
+ crtl->args.info.stack_regs * 8, + crtl->args.info.stack_regs * 8,
stack_pointer_rtx, e, NULL, false); stack_pointer_rtx, e, NULL, true);
if (crtl->calls_eh_return) if (crtl->calls_eh_return)
emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx, emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment