From: Bob Wilson Date: Thu, 7 Aug 2008 23:44:31 +0000 (+0000) Subject: xtensa.c (xtensa_copy_incoming_a7): Copy incoming value in a6 after the set_frame_ptr... X-Git-Tag: releases/gcc-4.4.0~3255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b412869cb2136a22b37d8d838611e6c513b89729;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff009ea3899c..8bc0abc53a4e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-08-07 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_copy_incoming_a7): Copy incoming value + in a6 after the set_frame_ptr insn. + 2008-08-07 Richard Henderson PR debug/37033 diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index ec8496534215..0f6bbb50ed6d 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 ();