Commit c1163e75 by Philip Blundell Committed by Phil Blundell

arm.c (arm_finalize_pic): New arg "prologue".

2001-01-15  Philip Blundell  <philb@gnu.org>

	* config/arm/arm.c (arm_finalize_pic): New arg "prologue".
	(is_pic): Delete.
	* config/arm/arm-protos.h (arm_finalize_pic): Update prototype.
	(is_pic): Delete declaration.
	* config/arm/arm.h (FINALIZE_PIC): Update call to above.
	(OUTPUT_INT_ADDR_CONST): Remove special handling of PIC address.
	* config/arm/arm.md (builtin_setjmp_receiver): Likewise.

From-SVN: r39049
parent 10a0ba84
2001-01-15 Philip Blundell <philb@gnu.org>
* config/arm/arm.c (arm_finalize_pic): New arg "prologue".
(is_pic): Delete.
* config/arm/arm-protos.h (arm_finalize_pic): Update prototype.
(is_pic): Delete declaration.
* config/arm/arm.h (FINALIZE_PIC): Update call to above.
(OUTPUT_INT_ADDR_CONST): Remove special handling of PIC address.
* config/arm/arm.md (builtin_setjmp_receiver): Likewise.
2001-01-15 Richard Earnshaw <rearnsha@arm.com> 2001-01-15 Richard Earnshaw <rearnsha@arm.com>
* arm.c (use_return_insn): Don't try to determine the function type * arm.c (use_return_insn): Don't try to determine the function type
......
...@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
extern void arm_override_options PARAMS ((void)); extern void arm_override_options PARAMS ((void));
extern int use_return_insn PARAMS ((int)); extern int use_return_insn PARAMS ((int));
extern int arm_regno_class PARAMS ((int)); extern int arm_regno_class PARAMS ((int));
extern void arm_finalize_pic PARAMS ((void)); extern void arm_finalize_pic PARAMS ((int));
extern int arm_volatile_func PARAMS ((void)); extern int arm_volatile_func PARAMS ((void));
extern const char * arm_output_epilogue PARAMS ((int)); extern const char * arm_output_epilogue PARAMS ((int));
extern void output_func_epilogue PARAMS ((int)); extern void output_func_epilogue PARAMS ((int));
...@@ -52,7 +52,6 @@ extern int arm_split_constant PARAMS ((RTX_CODE, enum machine_mode, ...@@ -52,7 +52,6 @@ extern int arm_split_constant PARAMS ((RTX_CODE, enum machine_mode,
extern RTX_CODE arm_canonicalize_comparison PARAMS ((RTX_CODE, rtx *)); extern RTX_CODE arm_canonicalize_comparison PARAMS ((RTX_CODE, rtx *));
extern int legitimate_pic_operand_p PARAMS ((rtx)); extern int legitimate_pic_operand_p PARAMS ((rtx));
extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx)); extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx));
extern int is_pic PARAMS ((rtx));
extern int arm_rtx_costs PARAMS ((rtx, RTX_CODE, RTX_CODE)); extern int arm_rtx_costs PARAMS ((rtx, RTX_CODE, RTX_CODE));
extern int arm_adjust_cost PARAMS ((rtx, rtx, rtx, int)); extern int arm_adjust_cost PARAMS ((rtx, rtx, rtx, int));
extern int const_double_rtx_ok_for_fpu PARAMS ((rtx)); extern int const_double_rtx_ok_for_fpu PARAMS ((rtx));
......
...@@ -2230,22 +2230,16 @@ legitimize_pic_address (orig, mode, reg) ...@@ -2230,22 +2230,16 @@ legitimize_pic_address (orig, mode, reg)
return orig; return orig;
} }
static rtx pic_rtx; /* Generate code to load the PIC register. PROLOGUE is true if
called from arm_expand_prologue (in which case we want the
int generated insns at the start of the function); false if called
is_pic (x) by an exception receiver that needs the PIC register reloaded
rtx x; (in which case the insns are just dumped at the current location). */
{
if (x == pic_rtx)
return 1;
return 0;
}
void void
arm_finalize_pic () arm_finalize_pic (int prologue)
{ {
#ifndef AOF_ASSEMBLER #ifndef AOF_ASSEMBLER
rtx l1, pic_tmp, pic_tmp2, seq; rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx;
rtx global_offset_table; rtx global_offset_table;
if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE)
...@@ -2282,7 +2276,10 @@ arm_finalize_pic () ...@@ -2282,7 +2276,10 @@ arm_finalize_pic ()
seq = gen_sequence (); seq = gen_sequence ();
end_sequence (); end_sequence ();
emit_insn_after (seq, get_insns ()); if (prologue)
emit_insn_after (seq, get_insns ());
else
emit_insn (seq);
/* Need to emit this whether or not we obey regdecls, /* Need to emit this whether or not we obey regdecls,
since setjmp/longjmp can cause life info to screw up. */ since setjmp/longjmp can cause life info to screw up. */
......
...@@ -2523,7 +2523,7 @@ extern const char * arm_pic_register_string; ...@@ -2523,7 +2523,7 @@ extern const char * arm_pic_register_string;
data addresses in memory. */ data addresses in memory. */
#define PIC_OFFSET_TABLE_REGNUM arm_pic_register #define PIC_OFFSET_TABLE_REGNUM arm_pic_register
#define FINALIZE_PIC arm_finalize_pic () #define FINALIZE_PIC arm_finalize_pic (1)
/* We can't directly access anything that contains a symbol, /* We can't directly access anything that contains a symbol,
nor can we indirect via the constant pool. */ nor can we indirect via the constant pool. */
...@@ -2851,18 +2851,9 @@ extern int making_const_table; ...@@ -2851,18 +2851,9 @@ extern int making_const_table;
else \ else \
THUMB_PRINT_OPERAND_ADDRESS (STREAM, X) THUMB_PRINT_OPERAND_ADDRESS (STREAM, X)
/* Handles PIC addr specially */
#define OUTPUT_INT_ADDR_CONST(STREAM, X) \ #define OUTPUT_INT_ADDR_CONST(STREAM, X) \
{ \ { \
if (flag_pic && GET_CODE (X) == CONST && is_pic (X)) \ output_addr_const (STREAM, X); \
{ \
output_addr_const (STREAM, XEXP (XEXP (XEXP (X, 0), 0), 0)); \
fputs (" - (", STREAM); \
output_addr_const (STREAM, XEXP (XEXP (XEXP (X, 0), 1), 0)); \
fputs (")", STREAM); \
} \
else \
output_addr_const (STREAM, X); \
\ \
/* Mark symbols as position independent. We only do this in the \ /* Mark symbols as position independent. We only do this in the \
.text segment, not in the .data segment. */ \ .text segment, not in the .data segment. */ \
......
...@@ -4238,6 +4238,15 @@ ...@@ -4238,6 +4238,15 @@
[(set_attr "predicable" "yes")] [(set_attr "predicable" "yes")]
) )
(define_expand "builtin_setjmp_receiver"
[(label_ref (match_operand 0 "" ""))]
"flag_pic"
"
{
arm_finalize_pic (0);
DONE;
}")
;; If copying one reg to another we can set the condition codes according to ;; If copying one reg to another we can set the condition codes according to
;; its value. Such a move is common after a return from subroutine and the ;; its value. Such a move is common after a return from subroutine and the
;; result is being tested against zero. ;; result is being tested against zero.
......
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