aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2008-08-07 23:44:31 +0000
committerBob Wilson <bwilson@gcc.gnu.org>2008-08-07 23:44:31 +0000
commitb412869cb2136a22b37d8d838611e6c513b89729 (patch)
tree013a34acf7c606a7ab69b75cda286e57c801b81f /gcc
parent09828811dcd5e78b9d2f7a239aeef665007a6a8a (diff)
downloadgcc-b412869cb2136a22b37d8d838611e6c513b89729.zip
gcc-b412869cb2136a22b37d8d838611e6c513b89729.tar.gz
gcc-b412869cb2136a22b37d8d838611e6c513b89729.tar.bz2
xtensa.c (xtensa_copy_incoming_a7): Copy incoming value in a6 after the set_frame_ptr insn.
* config/xtensa/xtensa.c (xtensa_copy_incoming_a7): Copy incoming value in a6 after the set_frame_ptr insn. From-SVN: r138851
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/xtensa/xtensa.c11
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ff009ea..8bc0abc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-07 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_copy_incoming_a7): Copy incoming value
+ in a6 after the set_frame_ptr insn.
+
2008-08-07 Richard Henderson <rth@redhat.com>
PR debug/37033
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index ec84965..0f6bbb5 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1030,8 +1030,10 @@ xtensa_copy_incoming_a7 (rtx opnd)
{
case DFmode:
case DImode:
- emit_insn (gen_movsi_internal (gen_rtx_SUBREG (SImode, tmp, 0),
- gen_rtx_REG (SImode, A7_REG - 1)));
+ /* Copy the value out of A7 here but keep the first word in A6 until
+ after the set_frame_ptr insn. Otherwise, the register allocator
+ may decide to put "subreg (tmp, 0)" in A7 and clobber the incoming
+ value. */
emit_insn (gen_movsi_internal (gen_rtx_SUBREG (SImode, tmp, 4),
gen_raw_REG (SImode, A7_REG)));
break;
@@ -1052,6 +1054,11 @@ xtensa_copy_incoming_a7 (rtx opnd)
}
cfun->machine->set_frame_ptr_insn = emit_insn (gen_set_frame_ptr ());
+
+ /* For DF and DI mode arguments, copy the incoming value in A6 now. */
+ if (mode == DFmode || mode == DImode)
+ emit_insn (gen_movsi_internal (gen_rtx_SUBREG (SImode, tmp, 0),
+ gen_rtx_REG (SImode, A7_REG - 1)));
entry_insns = get_insns ();
end_sequence ();