aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Blundell <philb@gnu.org>2001-01-15 19:54:42 +0000
committerPhil Blundell <pb@gcc.gnu.org>2001-01-15 19:54:42 +0000
commitc1163e75d8241f72ed143392f8477f469fb29f90 (patch)
treead4bd8934bdd12f0a0e78835059e29832d3764ec
parent10a0ba8488ce1de0e30fbc3b91079ab78ae32e10 (diff)
downloadgcc-c1163e75d8241f72ed143392f8477f469fb29f90.zip
gcc-c1163e75d8241f72ed143392f8477f469fb29f90.tar.gz
gcc-c1163e75d8241f72ed143392f8477f469fb29f90.tar.bz2
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
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/arm/arm-protos.h3
-rw-r--r--gcc/config/arm/arm.c25
-rw-r--r--gcc/config/arm/arm.h13
-rw-r--r--gcc/config/arm/arm.md9
5 files changed, 33 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ebda5b1..485edc2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+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
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 087d8cd..8f93761 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
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));
@@ -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 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));
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 0605d5f..13abef6 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2230,22 +2230,16 @@ legitimize_pic_address (orig, mode, reg)
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)
@@ -2282,7 +2276,10 @@ arm_finalize_pic ()
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. */
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index c1abdb2..3332c22 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -2523,7 +2523,7 @@ extern const char * arm_pic_register_string;
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. */
@@ -2851,18 +2851,9 @@ extern int making_const_table;
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. */ \
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 205dc37..a5d5a49 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4238,6 +4238,15 @@
[(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.