OSDN Git Service

* config/arm/arm.h (struct machine_function): Remove ra_rtx.
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Jun 2001 17:38:20 +0000 (17:38 +0000)
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Jun 2001 17:38:20 +0000 (17:38 +0000)
* config/arm/arm.c (arm_mark_machine_status): Remove ra_rtx.
(arm_return_addr): Use get_hard_reg_initial_val et al.
* config/d30v/d30v.h (struct machine_function): Remove ra_rtx.
* config/d30v/d30v.c (d30v_mark_machine_status): Remove ra_rtx.
(d30v_return_addr): Use get_hard_reg_initial_val et al.
* config/rs6000/rs6000.h (struct machine_function): Remove ra_rtx.
* config/rs6000/rs6000.c (rs6000_override_options): Don't set
mark_machine_status.
(rs6000_mark_machine_status): Remove.
(rs6000_return_addr): Use get_hard_reg_initial_val.
(rs6000_ra_ever_killed): Use has_hard_reg_initial_val.
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43507 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/d30v/d30v.c
gcc/config/d30v/d30v.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/v850/v850.c
gcc/config/v850/v850.h

index d6c7f33..928491e 100644 (file)
@@ -1,3 +1,25 @@
+2001-06-22  DJ Delorie  <dj@redhat.com>
+
+       * config/arm/arm.h (struct machine_function): Remove ra_rtx.
+       * config/arm/arm.c (arm_mark_machine_status): Remove ra_rtx.
+       (arm_return_addr): Use get_hard_reg_initial_val et al.
+       * config/d30v/d30v.h (struct machine_function): Remove ra_rtx.
+       * config/d30v/d30v.c (d30v_mark_machine_status): Remove ra_rtx.
+       (d30v_return_addr): Use get_hard_reg_initial_val et al.
+       * config/rs6000/rs6000.h (struct machine_function): Remove ra_rtx.
+       * config/rs6000/rs6000.c (rs6000_override_options): Don't set
+       mark_machine_status.
+       (rs6000_mark_machine_status): Remove.
+       (rs6000_return_addr): Use get_hard_reg_initial_val.
+       (rs6000_ra_ever_killed): Use has_hard_reg_initial_val.
+       * 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.
+
 Fri Jun 22 19:20:59 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
        * predict.c (estimate_bb_frequencies): Do not handle conditional
index ed4a35b..a1ce9c0 100644 (file)
@@ -9606,10 +9606,7 @@ arm_mark_machine_status (p)
   machine_function *machine = p->machine;
 
   if (machine)
-    {
-      ggc_mark_rtx (machine->ra_rtx);
-      ggc_mark_rtx (machine->eh_epilogue_sp_ofs);
-    }
+    ggc_mark_rtx (machine->eh_epilogue_sp_ofs);
 }
 
 static void
@@ -9642,37 +9639,17 @@ arm_return_addr (count, frame)
      int count;
      rtx frame ATTRIBUTE_UNUSED;
 {
-  rtx reg;
-
   if (count != 0)
     return NULL_RTX;
 
-  reg = cfun->machine->ra_rtx;
-  
-  if (reg == NULL)
+  if (TARGET_APCS_32)
+    return get_hard_reg_initial_val (Pmode, LR_REGNUM);
+  else
     {
-      rtx init;
-      
-      /* No rtx yet.  Invent one, and initialize it for r14 (lr) in 
-        the prologue.  */
-      reg = gen_reg_rtx (Pmode);
-      cfun->machine->ra_rtx = reg;
-      
-      if (!TARGET_APCS_32)
-       init = gen_rtx_AND (Pmode, gen_rtx_REG (Pmode, LR_REGNUM),
+      rtx lr = gen_rtx_AND (Pmode, gen_rtx_REG (Pmode, LR_REGNUM),
                            GEN_INT (RETURN_ADDR_MASK26));
-      else
-       init = gen_rtx_REG (Pmode, LR_REGNUM);
-
-      init = gen_rtx_SET (VOIDmode, reg, 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 get_func_hard_reg_initial_val (cfun, lr);
     }
-
-  return reg;
 }
 
 /* Do anything needed before RTL is emitted for each function.  */
index 073672f..8cd8b93 100644 (file)
@@ -1433,8 +1433,6 @@ enum reg_class
    This is added to the cfun structure.  */
 typedef struct machine_function
 {
-  /* Records __builtin_return address.  */
-  struct rtx_def *ra_rtx;
   /* Additionsl stack adjustment in __builtin_eh_throw.  */
   struct rtx_def *eh_epilogue_sp_ofs;
   /* Records if LR has to be saved for far jumps.  */
index b8f30aa..8f8f6d2 100644 (file)
@@ -3617,7 +3617,6 @@ d30v_mark_machine_status (p)
   if (p->machine == NULL)
     return;
   
-  ggc_mark_rtx (p->machine->ra_rtx);
   ggc_mark_rtx (p->machine->eh_epilogue_sp_ofs);
 }
 
@@ -3655,23 +3654,7 @@ d30v_init_expanders ()
 rtx
 d30v_return_addr ()
 {
-  rtx ret;
-
-  ret = cfun->machine->ra_rtx;
-  
-  if (ret == NULL)
-    {
-      rtx init;
-
-      cfun->machine->ra_rtx = ret = gen_reg_rtx (Pmode);
-
-      init = gen_rtx (SET, VOIDmode, ret, gen_rtx (REG, Pmode, GPR_LINK));
-      push_topmost_sequence ();
-      emit_insn_after (init, get_insns ());
-      pop_topmost_sequence ();
-    }
-
-  return ret;
+  return get_hard_reg_initial_val (Pmode, GPR_LINK);
 }
 
 /* Called to register all of our global variables with the garbage
index 7ac16e6..ca015b6 100644 (file)
@@ -2870,8 +2870,6 @@ typedef struct machine_function
 {
   /* Additionsl stack adjustment in __builtin_eh_throw.  */
   struct rtx_def * eh_epilogue_sp_ofs;
-  /* Records __builtin_return address.  */
-  struct rtx_def * ra_rtx;
 } machine_function;
 
 \f
index 3662fe8..2267b06 100644 (file)
@@ -122,7 +122,6 @@ static void toc_hash_mark_table PARAMS ((void *));
 static int constant_pool_expr_1 PARAMS ((rtx, int *, int *));
 static void rs6000_free_machine_status PARAMS ((struct function *));
 static void rs6000_init_machine_status PARAMS ((struct function *));
-static void rs6000_mark_machine_status PARAMS ((struct function *));
 static int rs6000_ra_ever_killed PARAMS ((void));
 \f
 /* Default register names.  */
@@ -404,7 +403,6 @@ rs6000_override_options (default_cpu)
 
   /* Arrange to save and restore machine status around nested functions.  */
   init_machine_status = rs6000_init_machine_status;
-  mark_machine_status = rs6000_mark_machine_status;
   free_machine_status = rs6000_free_machine_status;
 }
 
@@ -3751,14 +3749,6 @@ rs6000_init_machine_status (p)
 }
 
 static void
-rs6000_mark_machine_status (p)
-     struct function *p;
-{
-  if (p->machine)
-    ggc_mark_rtx (p->machine->ra_rtx);
-}
-
-static void
 rs6000_free_machine_status (p)
      struct function *p;
 {
@@ -5387,8 +5377,6 @@ rs6000_return_addr (count, frame)
      int count;
      rtx frame;
 {
-  rtx init, reg;
-
   /* Currently we don't optimize very well between prolog and body code and
      for PIC code the code can be actually quite bad, so don't try to be
      too clever here.  */
@@ -5406,23 +5394,7 @@ rs6000_return_addr (count, frame)
                                         RETURN_ADDRESS_OFFSET)));
     }
 
-  reg = cfun->machine->ra_rtx;
-  if (reg == NULL)
-    {
-      /* No rtx yet.  Invent one, and initialize it from LR in
-         the prologue.  */
-      reg = gen_reg_rtx (Pmode);
-      cfun->machine->ra_rtx = reg;
-      init = gen_rtx_SET (VOIDmode, reg,
-                         gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM));
-
-      /* 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 get_hard_reg_initial_val (Pmode, LINK_REGISTER_REGNUM);
 }
 
 static int
@@ -5434,7 +5406,8 @@ rs6000_ra_ever_killed ()
   if (current_function_is_thunk)
     return 0;
 #endif
-  if (!cfun->machine->ra_rtx || cfun->machine->ra_needs_full_frame)
+  if (!has_hard_reg_initial_val (Pmode, LINK_REGISTER_REGNUM)
+      || cfun->machine->ra_needs_full_frame)
     return regs_ever_live[LINK_REGISTER_REGNUM];
 
   push_topmost_sequence ();
index 1de9c7d..260262a 100644 (file)
@@ -1394,8 +1394,6 @@ typedef struct machine_function
 {
   /* Whether a System V.4 varargs area was created.  */
   int sysv_varargs_p;
-  /* Set if a return address rtx for loading from LR was created.  */
-  struct rtx_def *ra_rtx;
   /* Flags if __builtin_return_address (n) with n >= 1 was used.  */
   int ra_needs_full_frame;
 } machine_function;
index e97b76d..4883ab2 100644 (file)
@@ -51,9 +51,6 @@ static int  const_costs_int          PARAMS ((HOST_WIDE_INT, int));
 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;
@@ -2786,36 +2783,6 @@ v850_va_arg (valist, type)
   return addr_rtx;
 }
 \f
-/* 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.  */
 
@@ -2826,33 +2793,5 @@ v850_return_addr (count)
   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;
+  return get_hard_reg_initial_val (Pmode, LINK_POINTER_REGNUM);
 }
index 09632e7..4c94e80 100644 (file)
@@ -788,10 +788,6 @@ extern int current_function_anonymous_args;
 
 #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.  */