Commit f1acdf8b by Nick Clifton Committed by Nick Clifton

(output_return_instruction): Do not writeback the stack pointer when it is being loaded.

(output_return_instruction): Do not writeback the stack pointer when it is
being loaded.  (arm_output_epilogue): Likewise.

From-SVN: r57256
parent 24491a09
2002-09-17 Nick Clifton <nickc@redhat.com>
* config/arm/arm.c (output_return_instruction): Do not
writeback the stack pointer when it is being loaded.
(arm_output_epilogue): Likewise.
2002-09-17 Kazu Hirata <kazu@cs.umass.edu> 2002-09-17 Kazu Hirata <kazu@cs.umass.edu>
* optabs.c (prepare_cmp_insn): Let emit_library_call_value * optabs.c (prepare_cmp_insn): Let emit_library_call_value
......
...@@ -7325,6 +7325,8 @@ output_return_instruction (operand, really_return, reverse) ...@@ -7325,6 +7325,8 @@ output_return_instruction (operand, really_return, reverse)
/* Generate the load multiple instruction to restore the registers. */ /* Generate the load multiple instruction to restore the registers. */
if (frame_pointer_needed) if (frame_pointer_needed)
sprintf (instr, "ldm%sea\t%%|fp, {", conditional); sprintf (instr, "ldm%sea\t%%|fp, {", conditional);
else if (live_regs_mask & (1 << SP_REGNUM))
sprintf (instr, "ldm%sfd\t%%|sp, {", conditional);
else else
sprintf (instr, "ldm%sfd\t%%|sp!, {", conditional); sprintf (instr, "ldm%sfd\t%%|sp!, {", conditional);
...@@ -7736,7 +7738,16 @@ arm_output_epilogue (really_return) ...@@ -7736,7 +7738,16 @@ arm_output_epilogue (really_return)
asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM); asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
} }
else if (saved_regs_mask) else if (saved_regs_mask)
print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask); {
if (saved_regs_mask & (1 << SP_REGNUM))
/* Note - write back to the stack register is not enabled
(ie "ldmfd sp!..."). We know that the stack pointer is
in the list of registers and if we add writeback the
instruction becomes UNPREDICTABLE. */
print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
else
print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
}
if (current_function_pretend_args_size) if (current_function_pretend_args_size)
{ {
......
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