Commit 14976818 by Richard Sandiford Committed by Richard Sandiford

mips.h (TARGET_SPLIT_CALLS): Check TARGET_CALL_CLOBBERED_GP.

gcc/
	* config/mips/mips.h (TARGET_SPLIT_CALLS): Check
	TARGET_CALL_CLOBBERED_GP.
	(TARGET_SIBCALLS): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
	(TARGET_USE_GOT, TARGET_CALL_CLOBBERED_GP): New macros.
	(TARGET_CALL_SAVED_GP, TARGET_USE_PIC_FN_ADDR_REG): Likewise.
	(STARTING_FRAME_OFFSET): Check TARGET_CALL_CLOBBERED_GP instead
	of TARGET_ABICALLS && !TARGET_NEWABI.
	(MIPS_CALL): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
	* config/mips/mips.c (mips_load_call_address): Check
	TARGET_CALL_SAVED_GP instead of TARGET_NEWABI.
	(mips_global_pointer): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
	Check TARGET_CALL_SAVED_GP instead of TARGET_NEWABI.
	(mips_save_reg_p): Check TARGET_CALL_SAVED_GP instead of
	TARGET_ABICALLS && TARGET_NEWABI.
	(mips_current_loadgp_style): Check TARGET_USE_GOT instead of
	TARGET_ABICALLS.
	(mips_expand_prologue): Check TARGET_OLDABI instead of !TARGET_NEWABI.
	(mips_expand_epilogue): Check TARGET_CALL_SAVED_GP instead of
	TARGET_ABICALLS && TARGET_NEWABI.
	(mips_output_mi_thunk): Check TARGET_USE_GOT instead of
	TARGET_ABICALLS.  Check TARGET_CALL_SAVED_GP instead of
	TARGET_NEWABI.  Use TARGET_USE_PIC_FN_ADDR_REG to decide
	whether indirect calls must use $25.
	(mips_extra_live_on_entry): Check TARGET_GOT instead of
	TARGET_ABICALLS.
	* config/mips/mips.md (jal_macro): Check flag_pic and
	TARGET_CALL_CLOBBERED_GP instead of TARGET_ABICALLS and TARGET_NEWABI.
	(builtin_setjmp_setup, builtin_longjmp): Check TARGET_USE_GOT
	instead of TARGET_ABICALLS.
	(exception_receiver): Check TARGET_CALL_CLOBBERED_GP instead of
	TARGET_ABICALLS && TARGET_OLDABI.
	(load_call<mode>): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
	(sibcall): In the comment above the define_insn, mention
	TARGET_USE_PIC_FN_ADDR_REG instead of TARGET_ABICALLS.
	* config/mips/constraints.md (c): Check TARGET_USE_PIC_FN_ADDR_REG
	instead of TARGET_ABICALLS.

From-SVN: r123751
parent 2f118814
2007-04-12 Richard Sandiford <richard@codesourcery.com>
* config/mips/mips.h (TARGET_SPLIT_CALLS): Check
TARGET_CALL_CLOBBERED_GP.
(TARGET_SIBCALLS): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
(TARGET_USE_GOT, TARGET_CALL_CLOBBERED_GP): New macros.
(TARGET_CALL_SAVED_GP, TARGET_USE_PIC_FN_ADDR_REG): Likewise.
(STARTING_FRAME_OFFSET): Check TARGET_CALL_CLOBBERED_GP instead
of TARGET_ABICALLS && !TARGET_NEWABI.
(MIPS_CALL): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
* config/mips/mips.c (mips_load_call_address): Check
TARGET_CALL_SAVED_GP instead of TARGET_NEWABI.
(mips_global_pointer): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
Check TARGET_CALL_SAVED_GP instead of TARGET_NEWABI.
(mips_save_reg_p): Check TARGET_CALL_SAVED_GP instead of
TARGET_ABICALLS && TARGET_NEWABI.
(mips_current_loadgp_style): Check TARGET_USE_GOT instead of
TARGET_ABICALLS.
(mips_expand_prologue): Check TARGET_OLDABI instead of !TARGET_NEWABI.
(mips_expand_epilogue): Check TARGET_CALL_SAVED_GP instead of
TARGET_ABICALLS && TARGET_NEWABI.
(mips_output_mi_thunk): Check TARGET_USE_GOT instead of
TARGET_ABICALLS. Check TARGET_CALL_SAVED_GP instead of
TARGET_NEWABI. Use TARGET_USE_PIC_FN_ADDR_REG to decide
whether indirect calls must use $25.
(mips_extra_live_on_entry): Check TARGET_GOT instead of
TARGET_ABICALLS.
* config/mips/mips.md (jal_macro): Check flag_pic and
TARGET_CALL_CLOBBERED_GP instead of TARGET_ABICALLS and TARGET_NEWABI.
(builtin_setjmp_setup, builtin_longjmp): Check TARGET_USE_GOT
instead of TARGET_ABICALLS.
(exception_receiver): Check TARGET_CALL_CLOBBERED_GP instead of
TARGET_ABICALLS && TARGET_OLDABI.
(load_call<mode>): Check TARGET_USE_GOT instead of TARGET_ABICALLS.
(sibcall): In the comment above the define_insn, mention
TARGET_USE_PIC_FN_ADDR_REG instead of TARGET_ABICALLS.
* config/mips/constraints.md (c): Check TARGET_USE_PIC_FN_ADDR_REG
instead of TARGET_ABICALLS.
2007-04-12 Bernd Schmidt <bernd.schmidt@analog.com> 2007-04-12 Bernd Schmidt <bernd.schmidt@analog.com>
* doc/md.texi (Blackfin family constraints): Document PA and PB. * doc/md.texi (Blackfin family constraints): Document PA and PB.
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
(define_register_constraint "b" "ALL_REGS" (define_register_constraint "b" "ALL_REGS"
"@internal") "@internal")
(define_register_constraint "c" "TARGET_ABICALLS ? PIC_FN_ADDR_REG (define_register_constraint "c" "TARGET_USE_PIC_FN_ADDR_REG ? PIC_FN_ADDR_REG
: TARGET_MIPS16 ? M16_NA_REGS : TARGET_MIPS16 ? M16_NA_REGS
: GR_REGS" : GR_REGS"
"A register suitable for use in an indirect jump. This will always be "A register suitable for use in an indirect jump. This will always be
......
...@@ -3354,10 +3354,10 @@ mips_load_call_address (rtx dest, rtx addr, int sibcall_p) ...@@ -3354,10 +3354,10 @@ mips_load_call_address (rtx dest, rtx addr, int sibcall_p)
{ {
/* If we're generating PIC, and this call is to a global function, /* If we're generating PIC, and this call is to a global function,
try to allow its address to be resolved lazily. This isn't try to allow its address to be resolved lazily. This isn't
possible for NewABI sibcalls since the value of $gp on entry possible if TARGET_CALL_SAVED_GP since the value of $gp on entry
to the stub would be our caller's gp, not ours. */ to the stub would be our caller's gp, not ours. */
if (TARGET_EXPLICIT_RELOCS if (TARGET_EXPLICIT_RELOCS
&& !(sibcall_p && TARGET_NEWABI) && !(sibcall_p && TARGET_CALL_SAVED_GP)
&& global_got_operand (addr, VOIDmode)) && global_got_operand (addr, VOIDmode))
{ {
rtx high, lo_sum_symbol; rtx high, lo_sum_symbol;
...@@ -6144,8 +6144,8 @@ mips_global_pointer (void) ...@@ -6144,8 +6144,8 @@ mips_global_pointer (void)
{ {
unsigned int regno; unsigned int regno;
/* $gp is always available in non-abicalls code. */ /* $gp is always available unless we're using a GOT. */
if (!TARGET_ABICALLS) if (!TARGET_USE_GOT)
return GLOBAL_POINTER_REGNUM; return GLOBAL_POINTER_REGNUM;
/* We must always provide $gp when it is used implicitly. */ /* We must always provide $gp when it is used implicitly. */
...@@ -6182,7 +6182,7 @@ mips_global_pointer (void) ...@@ -6182,7 +6182,7 @@ mips_global_pointer (void)
/* We need a global pointer, but perhaps we can use a call-clobbered /* We need a global pointer, but perhaps we can use a call-clobbered
register instead of $gp. */ register instead of $gp. */
if (TARGET_NEWABI && current_function_is_leaf) if (TARGET_CALL_SAVED_GP && current_function_is_leaf)
for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++)
if (!regs_ever_live[regno] if (!regs_ever_live[regno]
&& call_used_regs[regno] && call_used_regs[regno]
...@@ -6199,10 +6199,10 @@ mips_global_pointer (void) ...@@ -6199,10 +6199,10 @@ mips_global_pointer (void)
static bool static bool
mips_save_reg_p (unsigned int regno) mips_save_reg_p (unsigned int regno)
{ {
/* We only need to save $gp for NewABI PIC. */ /* We only need to save $gp if TARGET_CALL_SAVED_GP and only then
if we have not chosen a call-clobbered substitute. */
if (regno == GLOBAL_POINTER_REGNUM) if (regno == GLOBAL_POINTER_REGNUM)
return (TARGET_ABICALLS && TARGET_NEWABI return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno;
&& cfun->machine->global_pointer == regno);
/* Check call-saved registers. */ /* Check call-saved registers. */
if (regs_ever_live[regno] && !call_used_regs[regno]) if (regs_ever_live[regno] && !call_used_regs[regno])
...@@ -6546,7 +6546,7 @@ mips_output_cplocal (void) ...@@ -6546,7 +6546,7 @@ mips_output_cplocal (void)
enum mips_loadgp_style enum mips_loadgp_style
mips_current_loadgp_style (void) mips_current_loadgp_style (void)
{ {
if (!TARGET_ABICALLS || cfun->machine->global_pointer == 0) if (!TARGET_USE_GOT || cfun->machine->global_pointer == 0)
return LOADGP_NONE; return LOADGP_NONE;
if (TARGET_ABSOLUTE_ABICALLS) if (TARGET_ABSOLUTE_ABICALLS)
...@@ -6858,7 +6858,7 @@ mips_expand_prologue (void) ...@@ -6858,7 +6858,7 @@ mips_expand_prologue (void)
mips_emit_loadgp (); mips_emit_loadgp ();
/* If generating o32/o64 abicalls, save $gp on the stack. */ /* If generating o32/o64 abicalls, save $gp on the stack. */
if (TARGET_ABICALLS && !TARGET_NEWABI && !current_function_is_leaf) if (TARGET_ABICALLS && TARGET_OLDABI && !current_function_is_leaf)
emit_insn (gen_cprestore (GEN_INT (current_function_outgoing_args_size))); emit_insn (gen_cprestore (GEN_INT (current_function_outgoing_args_size)));
/* If we are profiling, make sure no instructions are scheduled before /* If we are profiling, make sure no instructions are scheduled before
...@@ -6992,10 +6992,10 @@ mips_expand_epilogue (int sibcall_p) ...@@ -6992,10 +6992,10 @@ mips_expand_epilogue (int sibcall_p)
if (target != stack_pointer_rtx) if (target != stack_pointer_rtx)
emit_move_insn (stack_pointer_rtx, target); emit_move_insn (stack_pointer_rtx, target);
/* If we're using addressing macros for n32/n64 abicalls, $gp is /* If we're using addressing macros, $gp is implicitly used by all
implicitly used by all SYMBOL_REFs. We must emit a blockage SYMBOL_REFs. We must emit a blockage insn before restoring $gp
insn before restoring it. */ from the stack. */
if (TARGET_ABICALLS && TARGET_NEWABI && !TARGET_EXPLICIT_RELOCS) if (TARGET_CALL_SAVED_GP && !TARGET_EXPLICIT_RELOCS)
emit_insn (gen_blockage ()); emit_insn (gen_blockage ());
/* Restore the registers. */ /* Restore the registers. */
...@@ -7086,12 +7086,12 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, ...@@ -7086,12 +7086,12 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
reload_completed = 1; reload_completed = 1;
reset_block_changes (); reset_block_changes ();
/* Pick a global pointer for -mabicalls. Use $15 rather than $28 /* Pick a global pointer. Use a call-clobbered register if
for TARGET_NEWABI since the latter is a call-saved register. */ TARGET_CALL_SAVED_GP, so that we can use a sibcall. */
if (TARGET_ABICALLS) if (TARGET_USE_GOT)
cfun->machine->global_pointer cfun->machine->global_pointer
= REGNO (pic_offset_table_rtx) = REGNO (pic_offset_table_rtx)
= TARGET_NEWABI ? 15 : GLOBAL_POINTER_REGNUM; = TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM;
/* Set up the global pointer for n32 or n64 abicalls. */ /* Set up the global pointer for n32 or n64 abicalls. */
mips_emit_loadgp (); mips_emit_loadgp ();
...@@ -7137,24 +7137,27 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, ...@@ -7137,24 +7137,27 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Jump to the target function. Use a sibcall if direct jumps are /* Jump to the target function. Use a sibcall if direct jumps are
allowed, otherwise load the address into a register first. */ allowed, otherwise load the address into a register first. */
fnaddr = XEXP (DECL_RTL (function), 0); fnaddr = XEXP (DECL_RTL (function), 0);
if (TARGET_MIPS16 || TARGET_ABICALLS || TARGET_LONG_CALLS) if (TARGET_MIPS16 || TARGET_USE_GOT || TARGET_LONG_CALLS)
{ {
/* This is messy. gas treats "la $25,foo" as part of a call /* This is messy. gas treats "la $25,foo" as part of a call
sequence and may allow a global "foo" to be lazily bound. sequence and may allow a global "foo" to be lazily bound.
The general move patterns therefore reject this combination. The general move patterns therefore reject this combination.
In this context, lazy binding would actually be OK for o32 and o64, In this context, lazy binding would actually be OK
but it's still wrong for n32 and n64; see mips_load_call_address. for TARGET_CALL_CLOBBERED_GP, but it's still wrong for
We must therefore load the address via a temporary register if TARGET_CALL_SAVED_GP; see mips_load_call_address.
mips_dangerous_for_la25_p. We must therefore load the address via a temporary
register if mips_dangerous_for_la25_p.
If we jump to the temporary register rather than $25, the assembler If we jump to the temporary register rather than $25, the assembler
can use the move insn to fill the jump's delay slot. */ can use the move insn to fill the jump's delay slot. */
if (TARGET_ABICALLS && !mips_dangerous_for_la25_p (fnaddr)) if (TARGET_USE_PIC_FN_ADDR_REG
&& !mips_dangerous_for_la25_p (fnaddr))
temp1 = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM); temp1 = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
mips_load_call_address (temp1, fnaddr, true); mips_load_call_address (temp1, fnaddr, true);
if (TARGET_ABICALLS && REGNO (temp1) != PIC_FUNCTION_ADDR_REGNUM) if (TARGET_USE_PIC_FN_ADDR_REG
&& REGNO (temp1) != PIC_FUNCTION_ADDR_REGNUM)
emit_move_insn (gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM), temp1); emit_move_insn (gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM), temp1);
emit_jump_insn (gen_indirect_jump (temp1)); emit_jump_insn (gen_indirect_jump (temp1));
} }
...@@ -10878,13 +10881,13 @@ mips_encode_section_info (tree decl, rtx rtl, int first) ...@@ -10878,13 +10881,13 @@ mips_encode_section_info (tree decl, rtx rtl, int first)
} }
} }
/* Implement TARGET_EXTRA_LIVE_ON_ENTRY. PIC_FUNCTION_ADDR_REGNUM is live /* Implement TARGET_EXTRA_LIVE_ON_ENTRY. Some code models use the incoming
on entry to a function when generating -mshared abicalls code. */ value of PIC_FUNCTION_ADDR_REGNUM to set up the global pointer. */
static void static void
mips_extra_live_on_entry (bitmap regs) mips_extra_live_on_entry (bitmap regs)
{ {
if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS) if (TARGET_USE_GOT && !TARGET_ABSOLUTE_ABICALLS)
bitmap_set_bit (regs, PIC_FUNCTION_ADDR_REGNUM); bitmap_set_bit (regs, PIC_FUNCTION_ADDR_REGNUM);
} }
......
...@@ -144,12 +144,11 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -144,12 +144,11 @@ extern const struct mips_rtx_cost_data *mips_cost;
/* Run-time compilation parameters selecting different hardware subsets. */ /* Run-time compilation parameters selecting different hardware subsets. */
/* True if the call patterns should be split into a jalr followed by /* True if the call patterns should be split into a jalr followed by
an instruction to restore $gp. This is only ever true for SVR4 PIC, an instruction to restore $gp. It is only safe to split the load
in which $gp is call-clobbered. It is only safe to split the load
from the call when every use of $gp is explicit. */ from the call when every use of $gp is explicit. */
#define TARGET_SPLIT_CALLS \ #define TARGET_SPLIT_CALLS \
(TARGET_EXPLICIT_RELOCS && TARGET_ABICALLS && !TARGET_NEWABI) (TARGET_EXPLICIT_RELOCS && TARGET_CALL_CLOBBERED_GP)
/* True if we're generating a form of -mabicalls in which we can use /* True if we're generating a form of -mabicalls in which we can use
operators like %hi and %lo to refer to locally-binding symbols. operators like %hi and %lo to refer to locally-binding symbols.
...@@ -173,12 +172,22 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -173,12 +172,22 @@ extern const struct mips_rtx_cost_data *mips_cost;
using sibling calls in this case anyway; they would usually using sibling calls in this case anyway; they would usually
be longer than normal calls. be longer than normal calls.
- TARGET_ABICALLS && !TARGET_EXPLICIT_RELOCS. call_insn_operand - TARGET_USE_GOT && !TARGET_EXPLICIT_RELOCS. call_insn_operand
accepts global constants, but "jr $25" is the only allowed accepts global constants, but all sibcalls must be indirect. */
sibcall. */
#define TARGET_SIBCALLS \ #define TARGET_SIBCALLS \
(!TARGET_MIPS16 && (!TARGET_ABICALLS || TARGET_EXPLICIT_RELOCS)) (!TARGET_MIPS16 && (!TARGET_USE_GOT || TARGET_EXPLICIT_RELOCS))
/* True if we need to use a global offset table to access some symbols. */
#define TARGET_USE_GOT TARGET_ABICALLS
/* True if TARGET_USE_GOT and if $gp is a call-clobbered register. */
#define TARGET_CALL_CLOBBERED_GP (TARGET_ABICALLS && TARGET_OLDABI)
/* True if TARGET_USE_GOT and if $gp is a call-saved register. */
#define TARGET_CALL_SAVED_GP (TARGET_USE_GOT && !TARGET_CALL_CLOBBERED_GP)
/* True if indirect calls must use register class PIC_FN_ADDR_REG. */
#define TARGET_USE_PIC_FN_ADDR_REG TARGET_ABICALLS
/* True if .gpword or .gpdword should be used for switch tables. /* True if .gpword or .gpdword should be used for switch tables.
...@@ -1746,8 +1755,7 @@ extern const enum reg_class mips_regno_to_class[]; ...@@ -1746,8 +1755,7 @@ extern const enum reg_class mips_regno_to_class[];
((flag_profile_values && ! TARGET_64BIT \ ((flag_profile_values && ! TARGET_64BIT \
? MAX (REG_PARM_STACK_SPACE(NULL), current_function_outgoing_args_size) \ ? MAX (REG_PARM_STACK_SPACE(NULL), current_function_outgoing_args_size) \
: current_function_outgoing_args_size) \ : current_function_outgoing_args_size) \
+ (TARGET_ABICALLS && !TARGET_NEWABI \ + (TARGET_CALL_CLOBBERED_GP ? MIPS_STACK_ALIGN (UNITS_PER_WORD) : 0))
? MIPS_STACK_ALIGN (UNITS_PER_WORD) : 0))
#define RETURN_ADDR_RTX mips_return_addr #define RETURN_ADDR_RTX mips_return_addr
...@@ -2301,13 +2309,13 @@ typedef struct mips_args { ...@@ -2301,13 +2309,13 @@ typedef struct mips_args {
("j" or "jal"), OPERANDS are its operands, and OPNO is the operand number ("j" or "jal"), OPERANDS are its operands, and OPNO is the operand number
of the target. of the target.
When generating -mabicalls without explicit relocation operators, When generating GOT code without explicit relocation operators,
all calls should use assembly macros. Otherwise, all indirect all calls should use assembly macros. Otherwise, all indirect
calls should use "jr" or "jalr"; we will arrange to restore $gp calls should use "jr" or "jalr"; we will arrange to restore $gp
afterwards if necessary. Finally, we can only generate direct afterwards if necessary. Finally, we can only generate direct
calls for -mabicalls by temporarily switching to non-PIC mode. */ calls for -mabicalls by temporarily switching to non-PIC mode. */
#define MIPS_CALL(INSN, OPERANDS, OPNO) \ #define MIPS_CALL(INSN, OPERANDS, OPNO) \
(TARGET_ABICALLS && !TARGET_EXPLICIT_RELOCS \ (TARGET_USE_GOT && !TARGET_EXPLICIT_RELOCS \
? "%*" INSN "\t%" #OPNO "%/" \ ? "%*" INSN "\t%" #OPNO "%/" \
: REG_P (OPERANDS[OPNO]) \ : REG_P (OPERANDS[OPNO]) \
? "%*" INSN "r\t%" #OPNO "%/" \ ? "%*" INSN "r\t%" #OPNO "%/" \
......
...@@ -221,15 +221,16 @@ ...@@ -221,15 +221,16 @@
;; This attribute is YES if the instruction is a jal macro (not a ;; This attribute is YES if the instruction is a jal macro (not a
;; real jal instruction). ;; real jal instruction).
;; ;;
;; jal is always a macro for o32 and o64 abicalls because it includes an ;; jal is always a macro for TARGET_CALL_CLOBBERED_GP because it includes
;; instruction to restore $gp. Direct jals are also macros for -mshared ;; an instruction to restore $gp. Direct jals are also macros for
;; abicalls because they first load the target address into $25. ;; flag_pic && !TARGET_ABSOLUTE_ABICALLS because they first load
;; the target address into a register.
(define_attr "jal_macro" "no,yes" (define_attr "jal_macro" "no,yes"
(cond [(eq_attr "jal" "direct") (cond [(eq_attr "jal" "direct")
(symbol_ref "TARGET_ABICALLS (symbol_ref "TARGET_CALL_CLOBBERED_GP
&& (TARGET_OLDABI || !TARGET_ABSOLUTE_ABICALLS)") || (flag_pic && !TARGET_ABSOLUTE_ABICALLS)")
(eq_attr "jal" "indirect") (eq_attr "jal" "indirect")
(symbol_ref "TARGET_ABICALLS && TARGET_OLDABI")] (symbol_ref "TARGET_CALL_CLOBBERED_GP")]
(const_string "no"))) (const_string "no")))
;; Classification of each insn. ;; Classification of each insn.
...@@ -4947,14 +4948,14 @@ ...@@ -4947,14 +4948,14 @@
[(set_attr "type" "jump") [(set_attr "type" "jump")
(set_attr "mode" "none")]) (set_attr "mode" "none")])
;; For TARGET_ABICALLS, we save the gp in the jmp_buf as well. ;; For TARGET_USE_GOT, we save the gp in the jmp_buf as well.
;; While it is possible to either pull it off the stack (in the ;; While it is possible to either pull it off the stack (in the
;; o32 case) or recalculate it given t9 and our target label, ;; o32 case) or recalculate it given t9 and our target label,
;; it takes 3 or 4 insns to do so. ;; it takes 3 or 4 insns to do so.
(define_expand "builtin_setjmp_setup" (define_expand "builtin_setjmp_setup"
[(use (match_operand 0 "register_operand"))] [(use (match_operand 0 "register_operand"))]
"TARGET_ABICALLS" "TARGET_USE_GOT"
{ {
rtx addr; rtx addr;
...@@ -4969,7 +4970,7 @@ ...@@ -4969,7 +4970,7 @@
(define_expand "builtin_longjmp" (define_expand "builtin_longjmp"
[(use (match_operand 0 "register_operand"))] [(use (match_operand 0 "register_operand"))]
"TARGET_ABICALLS" "TARGET_USE_GOT"
{ {
/* The elements of the buffer are, in order: */ /* The elements of the buffer are, in order: */
int W = GET_MODE_SIZE (Pmode); int W = GET_MODE_SIZE (Pmode);
...@@ -5105,7 +5106,7 @@ ...@@ -5105,7 +5106,7 @@
(define_insn_and_split "exception_receiver" (define_insn_and_split "exception_receiver"
[(set (reg:SI 28) [(set (reg:SI 28)
(unspec_volatile:SI [(const_int 0)] UNSPEC_EH_RECEIVER))] (unspec_volatile:SI [(const_int 0)] UNSPEC_EH_RECEIVER))]
"TARGET_ABICALLS && TARGET_OLDABI" "TARGET_CALL_CLOBBERED_GP"
"#" "#"
"&& reload_completed" "&& reload_completed"
[(const_int 0)] [(const_int 0)]
...@@ -5143,7 +5144,7 @@ ...@@ -5143,7 +5144,7 @@
(match_operand:P 2 "immediate_operand" "") (match_operand:P 2 "immediate_operand" "")
(reg:P FAKE_CALL_REGNO)] (reg:P FAKE_CALL_REGNO)]
UNSPEC_LOAD_CALL))] UNSPEC_LOAD_CALL))]
"TARGET_ABICALLS" "TARGET_USE_GOT"
"<load>\t%0,%R2(%1)" "<load>\t%0,%R2(%1)"
[(set_attr "type" "load") [(set_attr "type" "load")
(set_attr "mode" "<MODE>") (set_attr "mode" "<MODE>")
...@@ -5157,9 +5158,10 @@ ...@@ -5157,9 +5158,10 @@
;; constraints. ;; constraints.
;; When we use an indirect jump, we need a register that will be ;; When we use an indirect jump, we need a register that will be
;; preserved by the epilogue. Since TARGET_ABICALLS forces us to ;; preserved by the epilogue. Since TARGET_USE_PIC_FN_ADDR_REG forces
;; use $25 for this purpose -- and $25 is never clobbered by the ;; us to use $25 for this purpose -- and $25 is never clobbered by the
;; epilogue -- we might as well use it for !TARGET_ABICALLS as well. ;; epilogue -- we might as well use it for !TARGET_USE_PIC_FN_ADDR_REG
;; as well.
(define_expand "sibcall" (define_expand "sibcall"
[(parallel [(call (match_operand 0 "") [(parallel [(call (match_operand 0 "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment