arm.c (arm_finalize_pic): New arg "prologue".
authorPhilip Blundell <philb@gnu.org>
Mon, 15 Jan 2001 19:54:42 +0000 (19:54 +0000)
committerPhil Blundell <pb@gcc.gnu.org>
Mon, 15 Jan 2001 19:54:42 +0000 (19:54 +0000)
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

gcc/ChangeLog
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/arm.md

index ebda5b141dcd1d254f1701e468ff53e65b148da1..485edc232c1991fc16fb4565a0cb116b05c68c84 100644 (file)
@@ -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
index 087d8cdb61f84a9367bc745fea162d2816c0feac..8f9376137fe9721cc83afd70584683e5f5745635 100644 (file)
@@ -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));
index 0605d5feee00b1a17eb75c7e68891f8a702998c8..13abef60c95d91b4308729c945b83eee193a9d99 100644 (file)
@@ -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.  */
index c1abdb2c31c0e57becbfd0e72e0eb1f2aa71a80a..3332c220a67b551d560aa0aa20b10648c3d12c8d 100644 (file)
@@ -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. */                      \
index 205dc3794c09a1054e899cd1ce15e9408b291d1b..a5d5a499c35a88ab696b407fa4b246f9aff34199 100644 (file)
   [(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.