This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Convert v850 to new initial_val functions.
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: Convert v850 to new initial_val functions.
- From: DJ Delorie <dj at redhat dot com>
- Date: Thu, 21 Jun 2001 15:25:46 -0400
- CC: dj at redhat dot com, nickc at redhat dot com, meissner at redhat dot com
2001-06-21 DJ Delorie <dj@redhat.com>
* config/v850/v850.h (INIT_EXPANDERS): Delete.
* config/v850/v850.c (struct machine_function): Delete.
(v850_init_machine_status): Delete.
(v850_mark_machine_status): Delete.
(v850_free_machine_status): Delete.
(v850_return_addr): Use get_hard_reg_initial_val.
(v850_init_expanders): Delete.
Index: v850.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.c,v
retrieving revision 1.40
diff -p -3 -r1.40 v850.c
*** v850.c 2001/05/04 15:06:41 1.40
--- v850.c 2001/06/21 19:22:19
*************** static int const_costs_int PAR
*** 51,59 ****
static void substitute_ep_register PARAMS ((rtx, rtx, int, int, rtx *, rtx *));
static int ep_memory_offset PARAMS ((enum machine_mode, int));
static void v850_set_data_area PARAMS ((tree, v850_data_area));
- static void v850_init_machine_status PARAMS ((struct function *));
- static void v850_mark_machine_status PARAMS ((struct function *));
- static void v850_free_machine_status PARAMS ((struct function *));
/* True if the current function has anonymous arguments. */
int current_function_anonymous_args;
--- 51,56 ----
*************** v850_va_arg (valist, type)
*** 2786,2821 ****
return addr_rtx;
}
- /* Functions to save and restore machine-specific function data. */
- struct machine_function
- {
- /* Records __builtin_return address. */
- struct rtx_def * ra_rtx;
- };
-
- static void
- v850_init_machine_status (p)
- struct function * p;
- {
- p->machine =
- (struct machine_function *) xcalloc (1, sizeof (struct machine_function));
- }
-
- static void
- v850_mark_machine_status (p)
- struct function * p;
- {
- ggc_mark_rtx (p->machine->ra_rtx);
- }
-
- static void
- v850_free_machine_status (p)
- struct function * p;
- {
- free (p->machine);
- p->machine = NULL;
- }
-
/* Return an RTX indicating where the return address to the
calling function can be found. */
--- 2783,2788 ----
*************** v850_return_addr (count)
*** 2826,2858 ****
if (count != 0)
return const0_rtx;
! if (cfun->machine->ra_rtx == NULL)
! {
! rtx init;
!
! /* No rtx yet. Invent one, and initialize it for r31 (lp) in
! the prologue. */
! cfun->machine->ra_rtx = gen_reg_rtx (Pmode);
!
! init = gen_rtx_REG (Pmode, LINK_POINTER_REGNUM);
!
! init = gen_rtx_SET (VOIDmode, cfun->machine->ra_rtx, init);
!
! /* Emit the insn to the prologue with the other argument copies. */
! push_topmost_sequence ();
! emit_insn_after (init, get_insns ());
! pop_topmost_sequence ();
! }
!
! return cfun->machine->ra_rtx;
! }
!
! /* Do anything needed before RTL is emitted for each function. */
!
! void
! v850_init_expanders ()
! {
! init_machine_status = v850_init_machine_status;
! mark_machine_status = v850_mark_machine_status;
! free_machine_status = v850_free_machine_status;
}
--- 2793,2797 ----
if (count != 0)
return const0_rtx;
! return get_hard_reg_initial_val (Pmode, LINK_POINTER_REGNUM);
}
Index: v850.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.h,v
retrieving revision 1.35
diff -p -3 -r1.35 v850.h
*** v850.h 2001/05/26 01:31:43 1.35
--- v850.h 2001/06/21 19:22:27
*************** extern int current_function_anonymous_ar
*** 788,797 ****
#define EXIT_IGNORE_STACK 1
- /* Initialize data used by insn expanders. This is called from insn_emit,
- once for every function before code is generated. */
- #define INIT_EXPANDERS v850_init_expanders ()
-
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
--- 788,793 ----