]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa.c (xtensa_copy_incoming_a7): Copy incoming value in a6 after the set_frame_ptr...
authorBob Wilson <bob.wilson@acm.org>
Thu, 7 Aug 2008 23:44:31 +0000 (23:44 +0000)
committerBob Wilson <bwilson@gcc.gnu.org>
Thu, 7 Aug 2008 23:44:31 +0000 (23:44 +0000)
* config/xtensa/xtensa.c (xtensa_copy_incoming_a7): Copy incoming value
in a6 after the set_frame_ptr insn.

From-SVN: r138851

gcc/ChangeLog
gcc/config/xtensa/xtensa.c

index ff009ea3899cfae4dec4a8bd90c2127965680082..8bc0abc53a4eec0868b2f5cb4bbe55c5ee920421 100644 (file)
@@ -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
index ec8496534215781f10f3119244bc23e0626f9c88..0f6bbb50ed6df2cd28f55557ddeb7452c96fc2c4 100644 (file)
@@ -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 ();