aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/cris/cris.c108
2 files changed, 98 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9fb2051..0906088 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-23 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/24342
+ * config/cris/cris.c (cris_split_movdx): Add REG_INC notes for
+ emitted insns with post-increments.
+ (cris_expand_epilogue): Ditto.
+
2005-12-22 Jakub Jelinek <jakub@redhat.com>
Richard Henderson <rth@redhat.com>
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 0c41539..63b5ba7 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -2353,12 +2353,31 @@ cris_split_movdx (rtx *operands)
if (GET_CODE (addr) == POST_INC)
{
- emit_insn (gen_rtx_SET (VOIDmode,
- operand_subword (dest, 0, TRUE, mode),
- change_address (src, SImode, addr)));
- emit_insn (gen_rtx_SET (VOIDmode,
- operand_subword (dest, 1, TRUE, mode),
- change_address (src, SImode, addr)));
+ rtx mem;
+ rtx insn;
+
+ /* Whenever we emit insns with post-incremented
+ addresses ourselves, we must add a post-inc note
+ manually. */
+ mem = change_address (src, SImode, addr);
+ insn
+ = gen_rtx_SET (VOIDmode,
+ operand_subword (dest, 0, TRUE, mode), mem);
+ insn = emit_insn (insn);
+ if (GET_CODE (XEXP (mem, 0)) == POST_INC)
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, XEXP (XEXP (mem, 0), 0),
+ REG_NOTES (insn));
+
+ mem = change_address (src, SImode, addr);
+ insn
+ = gen_rtx_SET (VOIDmode,
+ operand_subword (dest, 1, TRUE, mode), mem);
+ insn = emit_insn (insn);
+ if (GET_CODE (XEXP (mem, 0)) == POST_INC)
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, XEXP (XEXP (mem, 0), 0),
+ REG_NOTES (insn));
}
else
{
@@ -2399,12 +2418,31 @@ cris_split_movdx (rtx *operands)
if (GET_CODE (addr) == POST_INC)
{
- emit_insn (gen_rtx_SET (VOIDmode,
- change_address (dest, SImode, addr),
- operand_subword (src, 0, TRUE, mode)));
- emit_insn (gen_rtx_SET (VOIDmode,
- change_address (dest, SImode, addr),
- operand_subword (src, 1, TRUE, mode)));
+ rtx mem;
+ rtx insn;
+
+ /* Whenever we emit insns with post-incremented addresses
+ ourselves, we must add a post-inc note manually. */
+ mem = change_address (dest, SImode, addr);
+ insn
+ = gen_rtx_SET (VOIDmode,
+ mem, operand_subword (src, 0, TRUE, mode));
+ insn = emit_insn (insn);
+ if (GET_CODE (XEXP (mem, 0)) == POST_INC)
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, XEXP (XEXP (mem, 0), 0),
+ REG_NOTES (insn));
+
+ mem = change_address (dest, SImode, addr);
+ insn
+ = gen_rtx_SET (VOIDmode,
+ mem,
+ operand_subword (src, 1, TRUE, mode));
+ insn = emit_insn (insn);
+ if (GET_CODE (XEXP (mem, 0)) == POST_INC)
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, XEXP (XEXP (mem, 0), 0),
+ REG_NOTES (insn));
}
else
{
@@ -2780,6 +2818,8 @@ cris_expand_epilogue (void)
regno--)
if (cris_reg_saved_in_regsave_area (regno, got_really_used))
{
+ rtx insn;
+
if (argspace_offset)
{
/* There is an area for outgoing parameters located before
@@ -2795,12 +2835,19 @@ cris_expand_epilogue (void)
mem = gen_rtx_MEM (SImode, gen_rtx_POST_INC (SImode,
stack_pointer_rtx));
set_mem_alias_set (mem, get_frame_alias_set ());
- emit_move_insn (gen_rtx_raw_REG (SImode, regno), mem);
+ insn = emit_move_insn (gen_rtx_raw_REG (SImode, regno), mem);
+
+ /* Whenever we emit insns with post-incremented addresses
+ ourselves, we must add a post-inc note manually. */
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
}
/* If we have any movem-restore, do it now. */
if (last_movem_reg != -1)
{
+ rtx insn;
+
if (argspace_offset)
{
emit_insn (gen_rtx_SET (VOIDmode,
@@ -2813,7 +2860,14 @@ cris_expand_epilogue (void)
mem = gen_rtx_MEM (SImode,
gen_rtx_POST_INC (SImode, stack_pointer_rtx));
set_mem_alias_set (mem, get_frame_alias_set ());
- emit_insn (cris_gen_movem_load (mem, GEN_INT (last_movem_reg + 1), 0));
+ insn
+ = emit_insn (cris_gen_movem_load (mem,
+ GEN_INT (last_movem_reg + 1), 0));
+ /* Whenever we emit insns with post-incremented addresses
+ ourselves, we must add a post-inc note manually. */
+ if (side_effects_p (PATTERN (insn)))
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
}
/* If we don't clobber all of the allocated stack area (we've already
@@ -2829,13 +2883,20 @@ cris_expand_epilogue (void)
/* Restore frame pointer if necessary. */
if (frame_pointer_needed)
{
+ rtx insn;
+
emit_insn (gen_cris_frame_deallocated_barrier ());
emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
mem = gen_rtx_MEM (SImode, gen_rtx_POST_INC (SImode,
stack_pointer_rtx));
set_mem_alias_set (mem, get_frame_alias_set ());
- emit_move_insn (frame_pointer_rtx, mem);
+ insn = emit_move_insn (frame_pointer_rtx, mem);
+
+ /* Whenever we emit insns with post-incremented addresses
+ ourselves, we must add a post-inc note manually. */
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
}
else if ((size + argspace_offset) != 0)
{
@@ -2861,12 +2922,18 @@ cris_expand_epilogue (void)
if (current_function_calls_eh_return)
{
rtx mem;
+ rtx insn;
rtx srpreg = gen_rtx_raw_REG (SImode, CRIS_SRP_REGNUM);
mem = gen_rtx_MEM (SImode,
gen_rtx_POST_INC (SImode,
stack_pointer_rtx));
set_mem_alias_set (mem, get_frame_alias_set ());
- emit_move_insn (srpreg, mem);
+ insn = emit_move_insn (srpreg, mem);
+
+ /* Whenever we emit insns with post-incremented addresses
+ ourselves, we must add a post-inc note manually. */
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
@@ -2889,11 +2956,18 @@ cris_expand_epilogue (void)
{
rtx mem;
rtx srpreg = gen_rtx_raw_REG (SImode, CRIS_SRP_REGNUM);
+ rtx insn;
+
mem = gen_rtx_MEM (SImode,
gen_rtx_POST_INC (SImode,
stack_pointer_rtx));
set_mem_alias_set (mem, get_frame_alias_set ());
- emit_move_insn (srpreg, mem);
+ insn = emit_move_insn (srpreg, mem);
+
+ /* Whenever we emit insns with post-incremented addresses
+ ourselves, we must add a post-inc note manually. */
+ REG_NOTES (insn)
+ = alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
}
emit_insn (gen_rtx_SET (VOIDmode,