+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>
* arm.c (use_return_insn): Don't try to determine the function type
extern void arm_override_options PARAMS ((void));
extern int use_return_insn 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 const char * arm_output_epilogue PARAMS ((int));
extern void output_func_epilogue PARAMS ((int));
extern RTX_CODE arm_canonicalize_comparison PARAMS ((RTX_CODE, rtx *));
extern int legitimate_pic_operand_p PARAMS ((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_adjust_cost PARAMS ((rtx, rtx, rtx, int));
extern int const_double_rtx_ok_for_fpu PARAMS ((rtx));
return orig;
}
-static rtx pic_rtx;
-
-int
-is_pic (x)
- rtx x;
-{
- if (x == pic_rtx)
- return 1;
- return 0;
-}
-
+/* Generate code to load the PIC register. PROLOGUE is true if
+ called from arm_expand_prologue (in which case we want the
+ generated insns at the start of the function); false if called
+ by an exception receiver that needs the PIC register reloaded
+ (in which case the insns are just dumped at the current location). */
void
-arm_finalize_pic ()
+arm_finalize_pic (int prologue)
{
#ifndef AOF_ASSEMBLER
- rtx l1, pic_tmp, pic_tmp2, seq;
+ rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx;
rtx global_offset_table;
if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE)
seq = gen_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,
since setjmp/longjmp can cause life info to screw up. */
data addresses in memory. */
#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,
nor can we indirect via the constant pool. */
else \
THUMB_PRINT_OPERAND_ADDRESS (STREAM, X)
-/* Handles PIC addr specially */
#define OUTPUT_INT_ADDR_CONST(STREAM, X) \
{ \
- if (flag_pic && GET_CODE (X) == CONST && is_pic (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); \
+ output_addr_const (STREAM, X); \
\
/* Mark symbols as position independent. We only do this in the \
.text segment, not in the .data segment. */ \
[(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
;; its value. Such a move is common after a return from subroutine and the
;; result is being tested against zero.