From: Eric Botcazou Date: Sat, 11 Feb 2012 00:14:08 +0000 (+0000) Subject: sparc.c (sparc_flat_expand_prologue): Use emit_use. X-Git-Tag: upstream/12.2.0~78047 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c92f3e81be19ed6f544c06ee313af0cf5af107b;p=platform%2Fupstream%2Fgcc.git sparc.c (sparc_flat_expand_prologue): Use emit_use. * 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. From-SVN: r184116 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9fce971..391217a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-02-10 Eric Botcazou + + * 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 PR c/52190 diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 40db03f..134843d 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -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); } } diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index f67ee83..f70acd3 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -99,7 +99,6 @@ (define_constants [(UNSPECV_BLOCKAGE 0) (UNSPECV_FLUSHW 1) - (UNSPECV_GOTO 2) (UNSPECV_FLUSH 4) (UNSPECV_SAVEW 6) (UNSPECV_CAS 8) @@ -6524,6 +6523,7 @@ (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]; @@ -6540,44 +6540,19 @@ /* 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"