OSDN Git Service

* config/sparc/sparc.c (sparc_flat_expand_prologue): Use emit_use.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 11 Feb 2012 00:14:08 +0000 (00:14 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 11 Feb 2012 00:14:08 +0000 (00:14 +0000)
* config/sparc/sparc.md (UNSPECV_GOTO): Delete.
(nonlocal_goto_internal): Likewise.
(nonlocal_goto): Emit a use and an indirect jump directly.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184116 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.md

index 9fce971..391217a 100644 (file)
@@ -1,3 +1,10 @@
+2012-02-10  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/sparc/sparc.c (sparc_flat_expand_prologue): Use emit_use.
+       * config/sparc/sparc.md (UNSPECV_GOTO): Delete.
+       (nonlocal_goto_internal): Likewise.
+       (nonlocal_goto): Emit a use and an indirect jump directly.
+
 2012-02-10  Andrew MacLeod  <amacleod@redhat.com>
 
        PR c/52190
index 40db03f..134843d 100644 (file)
@@ -5131,7 +5131,7 @@ sparc_flat_expand_prologue (void)
 
          /* Prevent this instruction from ever being considered dead,
             even if this function has no epilogue.  */
-         emit_insn (gen_rtx_USE (VOIDmode, i7));
+         emit_use (i7);
        }
     }
 
index f67ee83..f70acd3 100644 (file)
@@ -99,7 +99,6 @@
 (define_constants
   [(UNSPECV_BLOCKAGE           0)
    (UNSPECV_FLUSHW             1)
-   (UNSPECV_GOTO               2)
    (UNSPECV_FLUSH              4)
    (UNSPECV_SAVEW              6)
    (UNSPECV_CAS                        8)
    (match_operand 3 "memory_operand" "")]
   ""
 {
+  rtx i7 = gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM);
   rtx r_label = copy_to_reg (operands[1]);
   rtx r_sp = adjust_address_nv (operands[2], Pmode, 0);
   rtx r_fp = operands[3];
   /* Restore frame pointer for containing function.  */
   emit_move_insn (hard_frame_pointer_rtx, r_fp);
   emit_stack_restore (SAVE_NONLOCAL, r_sp);
+  emit_move_insn (i7, r_i7);
 
   /* USE of hard_frame_pointer_rtx added for consistency;
      not clear if really needed.  */
   emit_use (hard_frame_pointer_rtx);
   emit_use (stack_pointer_rtx);
+  emit_use (i7);
 
-  /* We need to smuggle the load of %i7 as it is a fixed register.  */
-  emit_jump_insn (gen_nonlocal_goto_internal (r_label, r_i7));
+  emit_jump_insn (gen_indirect_jump (r_label));
   emit_barrier ();
   DONE;
 })
 
-(define_insn "nonlocal_goto_internal"
-  [(unspec_volatile [(match_operand 0 "register_operand" "r")
-                     (match_operand 1 "memory_operand" "m")] UNSPECV_GOTO)]
-  "GET_MODE (operands[0]) == Pmode && GET_MODE (operands[1]) == Pmode"
-{
-  if (flag_delayed_branch)
-    {
-      if (TARGET_ARCH64)
-       return "jmp\t%0\n\t ldx\t%1, %%i7";
-      else
-       return "jmp\t%0\n\t ld\t%1, %%i7";
-    }
-  else
-    {
-      if (TARGET_ARCH64)
-       return "ldx\t%1, %%i7\n\tjmp\t%0\n\t nop";
-      else
-       return "ld\t%1, %%i7\n\tjmp\t%0\n\t nop";
-    }
-}
-  [(set (attr "type") (const_string "multi"))
-   (set (attr "length")
-       (if_then_else (eq_attr "delayed_branch" "true")
-                     (const_int 2)
-                     (const_int 3)))])
-
 (define_expand "builtin_setjmp_receiver"
   [(label_ref (match_operand 0 "" ""))]
   "flag_pic"