This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Convert alpha to new initial_val functions.



2001-06-21  DJ Delorie  <dj@redhat.com>

	* config/alpha/alpha.h (struct machine_function): Remove.
	* config/alpha/alpha.c (integrate.h): Include.
	(override_options): Don't set up machine_status hooks.
	(alpha_init_machine_status): Remove.
	(alpha_mark_machine_status): Remove.
	(alpha_free_machine_status): Remove.
	(alpha_return_addr): Use get_hard_reg_initial_val.
	(alpha_gp_save_rtx): Likewise.
	(alpha_ra_ever_killed): Use has_hard_reg_initial_val.

Index: alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.163
diff -p -3 -r1.163 alpha.c
*** alpha.c	2001/06/11 16:27:25	1.163
--- alpha.c	2001/06/21 16:58:01
*************** Boston, MA 02111-1307, USA.  */
*** 42,47 ****
--- 42,48 ----
  #include "toplev.h"
  #include "ggc.h"
  #include "tm_p.h"
+ #include "integrate.h"
  
  /* External data.  */
  extern int rtx_equal_function_value_matters;
*************** override_options ()
*** 357,367 ****
  
    /* Acquire a unique set number for our register saves and restores.  */
    alpha_sr_alias_set = new_alias_set ();
- 
-   /* Set up function hooks.  */
-   init_machine_status = alpha_init_machine_status;
-   mark_machine_status = alpha_mark_machine_status;
-   free_machine_status = alpha_free_machine_status;
  }
  
  /* Returns 1 if VALUE is a mask that contains full bytes of zero or ones.  */
--- 358,363 ----
*************** alpha_adjust_cost (insn, link, dep_insn,
*** 3661,3695 ****
  
  /* Functions to save and restore alpha_return_addr_rtx.  */
  
- static void
- alpha_init_machine_status (p)
-      struct function *p;
- {
-   p->machine =
-     (struct machine_function *) xcalloc (1, sizeof (struct machine_function));
- }
- 
- static void
- alpha_mark_machine_status (p)
-      struct function *p;
- {
-   struct machine_function *machine = p->machine;
- 
-   if (machine)
-     {
-       ggc_mark_rtx (machine->ra_rtx);
-       ggc_mark_rtx (machine->gp_save_rtx);
-     }
- }
- 
- static void
- alpha_free_machine_status (p)
-      struct function *p;
- {
-   free (p->machine);
-   p->machine = NULL;
- }
- 
  /* Start the ball rolling with RETURN_ADDR_RTX.  */
  
  rtx
--- 3657,3662 ----
*************** alpha_return_addr (count, frame)
*** 3697,3723 ****
       int count;
       rtx frame ATTRIBUTE_UNUSED;
  {
-   rtx init, reg;
- 
    if (count != 0)
      return const0_rtx;
- 
-   reg = cfun->machine->ra_rtx;
-   if (reg == NULL)
-     {
-       /* No rtx yet.  Invent one, and initialize it from $26 in
- 	 the prologue.  */
-       reg = gen_reg_rtx (Pmode);
-       cfun->machine->ra_rtx = reg;
-       init = gen_rtx_SET (VOIDmode, reg, gen_rtx_REG (Pmode, REG_RA));
- 
-       /* Emit the insn to the prologue with the other argument copies.  */
-       push_topmost_sequence ();
-       emit_insn_after (init, get_insns ());
-       pop_topmost_sequence ();
-     }
  
!   return reg;
  }
  
  /* Return or create a pseudo containing the gp value for the current
--- 3664,3673 ----
       int count;
       rtx frame ATTRIBUTE_UNUSED;
  {
    if (count != 0)
      return const0_rtx;
  
!   return get_hard_reg_initial_val (Pmode, REG_RA);
  }
  
  /* Return or create a pseudo containing the gp value for the current
*************** alpha_return_addr (count, frame)
*** 3726,3746 ****
  rtx
  alpha_gp_save_rtx ()
  {
!   rtx init, reg;
! 
!   reg = cfun->machine->gp_save_rtx;
!   if (reg == NULL)
!     {
!       reg = gen_reg_rtx (DImode);
!       cfun->machine->gp_save_rtx = reg;
!       init = gen_rtx_SET (VOIDmode, reg, gen_rtx_REG (DImode, 29));
! 
!       push_topmost_sequence ();
!       emit_insn_after (init, get_insns ());
!       pop_topmost_sequence ();
!     }
! 
!   return reg;
  }
  
  static int
--- 3676,3682 ----
  rtx
  alpha_gp_save_rtx ()
  {
!   return get_hard_reg_initial_val (DImode, 29);
  }
  
  static int
*************** alpha_ra_ever_killed ()
*** 3752,3758 ****
    if (current_function_is_thunk)
      return 0;
  #endif
!   if (!cfun->machine->ra_rtx)
      return regs_ever_live[REG_RA];
  
    push_topmost_sequence ();
--- 3688,3694 ----
    if (current_function_is_thunk)
      return 0;
  #endif
!   if (!has_hard_reg_initial_val (Pmode, REG_RA))
      return regs_ever_live[REG_RA];
  
    push_topmost_sequence ();
Index: alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.120
diff -p -3 -r1.120 alpha.h
*** alpha.h	2001/06/11 16:27:25	1.120
--- alpha.h	2001/06/21 16:58:10
*************** struct alpha_compare
*** 1185,1201 ****
  
  extern struct alpha_compare alpha_compare;
  
- /* Machine specific function data.  */
- 
- struct machine_function
- {
-   /* If non-null, this rtx holds the return address for the function.  */
-   struct rtx_def *ra_rtx;
- 
-   /* If non-null, this rtx holds a saved copy of the GP for the function.  */
-   struct rtx_def *gp_save_rtx;
- };
- 
  /* Make (or fake) .linkage entry for function call.
     IS_LOCAL is 0 if name is used in call, 1 if name is used in definition.  */
  
--- 1185,1190 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]