From d777856dc899138fa15029c6f7490614c176d765 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Mon, 9 Jul 2001 22:55:21 +0000 Subject: [PATCH] pa.c (pa_init_machine_status, [...]): Delete. * pa.c (pa_init_machine_status, pa_mark_machine_status, pa_free_machine_status, hppa_init_pic_save): Delete. (hppa_pic_save_rtx): New. Use get_hard_reg_initial_val. (hppa_profile_hook): Use hppa_pic_save_rtx. * pa.h (struct machine_function, PIC_OFFSET_TABLE_SAVE_RTX, hppa_init_pic_save): Delete. (hppa_pic_save_rtx): Declare. * pa.md (call, call_value, sibcall, sibcall_value, builtin_setjmp_receiver): Use hppa_pic_save_rtx. From-SVN: r43883 --- gcc/ChangeLog | 12 +++++++++ gcc/config/pa/pa.c | 66 ++++----------------------------------------- gcc/config/pa/pa.h | 13 +++------ gcc/config/pa/pa.md | 25 ++++------------- 4 files changed, 25 insertions(+), 91 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62516014b80..cd1ac54fd1d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2001-07-09 John David Anglin + + * pa.c (pa_init_machine_status, pa_mark_machine_status, + pa_free_machine_status, hppa_init_pic_save): Delete. + (hppa_pic_save_rtx): New. Use get_hard_reg_initial_val. + (hppa_profile_hook): Use hppa_pic_save_rtx. + * pa.h (struct machine_function, PIC_OFFSET_TABLE_SAVE_RTX, + hppa_init_pic_save): Delete. + (hppa_pic_save_rtx): Declare. + * pa.md (call, call_value, sibcall, sibcall_value, + builtin_setjmp_receiver): Use hppa_pic_save_rtx. + 2001-07-09 Kazu Hirata * config/h8300/t-h8300 (LIB1ASMFUNCS): Add _floatdisf and _fixsfdi. diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 36aad1b5b7a..05de6dd7edd 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */ #include "reload.h" #include "expr.h" #include "c-tree.h" +#include "integrate.h" #include "function.h" #include "obstack.h" #include "toplev.h" @@ -52,9 +53,6 @@ Boston, MA 02111-1307, USA. */ #endif #endif -static void pa_init_machine_status PARAMS ((struct function *)); -static void pa_mark_machine_status PARAMS ((struct function *)); -static void pa_free_machine_status PARAMS ((struct function *)); static inline rtx force_mode PARAMS ((enum machine_mode, rtx)); static void pa_combine_instructions PARAMS ((rtx)); static int pa_can_combine_p PARAMS ((rtx, rtx, rtx, int, rtx, rtx, rtx)); @@ -202,46 +200,8 @@ override_options () /* Register global variables with the garbage collector. */ pa_add_gc_roots (); - - /* Arrange to save and restore machine status around nested functions. */ - init_machine_status = pa_init_machine_status; - mark_machine_status = pa_mark_machine_status; - free_machine_status = pa_free_machine_status; -} - -/* Functions to initialize pic_offset_table_save_rtx. - These will be called, via pointer variables, - from push_function_context and pop_function_context. */ - -static void -pa_init_machine_status (p) - struct function *p; -{ - p->machine = (machine_function *) xmalloc (sizeof (machine_function)); - - p->machine->pic_offset_table_save_rtx = NULL_RTX; -} - -static void -pa_mark_machine_status (p) - struct function *p; -{ - if (p->machine) - ggc_mark_rtx (p->machine->pic_offset_table_save_rtx); -} - -static void -pa_free_machine_status (p) - struct function *p; -{ - if (p->machine == NULL) - return; - - free (p->machine); - p->machine = NULL; } - /* Return non-zero only if OP is a register of mode MODE, or CONST0_RTX. */ int @@ -3397,23 +3357,10 @@ hppa_expand_epilogue () FRP (load_reg (2, ret_off, STACK_POINTER_REGNUM)); } -/* Set up a callee saved register for the pic offset table register. */ -void -hppa_init_pic_save () +rtx +hppa_pic_save_rtx () { - rtx insn, picreg; - - picreg = gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM); - PIC_OFFSET_TABLE_SAVE_RTX = gen_reg_rtx (Pmode); - RTX_UNCHANGING_P (PIC_OFFSET_TABLE_SAVE_RTX) = 1; - insn = gen_rtx_SET (VOIDmode, PIC_OFFSET_TABLE_SAVE_RTX, picreg); - - /* Emit the insn at the beginning of the function after the prologue. */ - if (tail_recursion_reentry) - emit_insn_before (insn, tail_recursion_reentry); - else - /* We must have been called via PROFILE_HOOK. */ - emit_insn (insn); + return get_hard_reg_initial_val (word_mode, PIC_OFFSET_TABLE_REGNUM); } void @@ -3434,9 +3381,6 @@ hppa_profile_hook (label_no) gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx, GEN_INT (64))); - if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX) - hppa_init_pic_save (); - emit_move_insn (gen_rtx_REG (word_mode, 26), gen_rtx_REG (word_mode, 2)); #ifndef NO_PROFILE_COUNTERS @@ -3495,7 +3439,7 @@ hppa_profile_hook (label_no) if (TARGET_64BIT) use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx); - emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX); + emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ()); } } diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 28b496d885a..09d4e14bf85 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -71,12 +71,6 @@ enum architecture_type }; struct rtx_def; -/* A C structure for machine-specific, per-function data. - This is added to the cfun structure. */ -typedef struct machine_function -{ - struct rtx_def *pic_offset_table_save_rtx; -} machine_function; /* For -march= option. */ extern const char *pa_arch_string; @@ -517,10 +511,9 @@ extern int target_flags; #define PIC_OFFSET_TABLE_REGNUM (TARGET_64BIT ? 27 : 19) #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 1 -/* Register into which we save the PIC_OFFSET_TABLE_REGNUM so that it - can be restored across function calls. */ -#define PIC_OFFSET_TABLE_SAVE_RTX (cfun->machine->pic_offset_table_save_rtx) -extern void hppa_init_pic_save PARAMS ((void)); +/* Function to return the rtx used to save the pic offset table register + across function calls. */ +extern struct rtx_def *hppa_pic_save_rtx PARAMS ((void)); #define DEFAULT_PCC_STRUCT_RETURN 0 diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 59b4c766fa2..3e2efad0527 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5697,9 +5697,6 @@ gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx, GEN_INT (64))); - if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX) - hppa_init_pic_save (); - /* Use two different patterns for calls to explicitly named functions and calls through function pointers. This is necessary as these two types of calls use different calling conventions, and CSE might try @@ -5728,7 +5725,7 @@ /* After each call we must restore the PIC register, even if it doesn't appear to be used. */ - emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX); + emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ()); } DONE; }") @@ -5869,9 +5866,6 @@ gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx, GEN_INT (64))); - if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX) - hppa_init_pic_save (); - /* Use two different patterns for calls to explicitly named functions and calls through function pointers. This is necessary as these two types of calls use different calling conventions, and CSE might try @@ -5904,7 +5898,7 @@ /* After each call we must restore the PIC register, even if it doesn't appear to be used. */ - emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX); + emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ()); } DONE; }") @@ -6067,9 +6061,6 @@ op = XEXP (operands[0], 0); - if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX) - hppa_init_pic_save (); - /* We do not allow indirect sibling calls. */ call_insn = emit_call_insn (gen_sibcall_internal_symref (op, operands[1])); @@ -6079,7 +6070,7 @@ /* After each call we must restore the PIC register, even if it doesn't appear to be used. */ - emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX); + emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ()); } DONE; }") @@ -6125,9 +6116,6 @@ op = XEXP (operands[1], 0); - if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX) - hppa_init_pic_save (); - /* We do not allow indirect sibling calls. */ call_insn = emit_call_insn (gen_sibcall_value_internal_symref (operands[0], op, @@ -6138,7 +6126,7 @@ /* After each call we must restore the PIC register, even if it doesn't appear to be used. */ - emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX); + emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ()); } DONE; }") @@ -7135,12 +7123,9 @@ "flag_pic" " { - if (PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX) - hppa_init_pic_save (); - /* Restore the PIC register. Hopefully, this will always be from a stack slot. The only registers that are valid after a builtin_longjmp are the stack and frame pointers. */ - emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX); + emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ()); DONE; }") -- 2.30.2