aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2007-04-28 00:07:40 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2007-04-28 00:07:40 +0000
commiteb996a4ac9d4abe017e094872f638ecee872c2cb (patch)
tree0ddbb1979b558e1cfe35d3ccf0e84d85dc7fac57
parent805ea2f32d7d203204992a11d436a4221872ec9e (diff)
downloadgcc-eb996a4ac9d4abe017e094872f638ecee872c2cb.zip
gcc-eb996a4ac9d4abe017e094872f638ecee872c2cb.tar.gz
gcc-eb996a4ac9d4abe017e094872f638ecee872c2cb.tar.bz2
re PR target/31701 (SH: wrong epilogue for sibling calls)
PR target/31701 * config/sh/sh.c (output_stack_adjust): Avoid using the frame register itself to hold the offset constant. Tell flow the use of r4 and r5 when they are used. From-SVN: r124248
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/sh/sh.c11
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8363fbc..bd61b8e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-27 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/31701
+ * config/sh/sh.c (output_stack_adjust): Avoid using the frame
+ register itself to hold the offset constant. Tell flow the use
+ of r4 and r5 when they are used.
+
2007-04-27 Richard Guenther <rguenther@suse.de>
* tree-ssa-forwprop.c (forward_propagate_into_cond): Keep track
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 0aeb764..ffa2509 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -5619,7 +5619,13 @@ output_stack_adjust (int size, rtx reg, int epilogue_p,
temp = scavenge_reg (&temps);
}
if (temp < 0 && live_regs_mask)
- temp = scavenge_reg (live_regs_mask);
+ {
+ HARD_REG_SET temps;
+
+ COPY_HARD_REG_SET (temps, *live_regs_mask);
+ CLEAR_HARD_REG_BIT (temps, REGNO (reg));
+ temp = scavenge_reg (&temps);
+ }
if (temp < 0)
{
rtx adj_reg, tmp_reg, mem;
@@ -5668,6 +5674,9 @@ output_stack_adjust (int size, rtx reg, int epilogue_p,
emit_move_insn (adj_reg, mem);
mem = gen_tmp_stack_mem (Pmode, gen_rtx_POST_INC (Pmode, reg));
emit_move_insn (tmp_reg, mem);
+ /* Tell flow the insns that pop r4/r5 aren't dead. */
+ emit_insn (gen_rtx_USE (VOIDmode, tmp_reg));
+ emit_insn (gen_rtx_USE (VOIDmode, adj_reg));
return;
}
const_reg = gen_rtx_REG (GET_MODE (reg), temp);