oops - omitted from previous delta
authorNick Clifton <nickc@gcc.gnu.org>
Tue, 9 Jan 2001 19:38:25 +0000 (19:38 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Tue, 9 Jan 2001 19:38:25 +0000 (19:38 +0000)
From-SVN: r38838

gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/sysv4.h

index 38b35deb469bc3dbf8288a70db6124d5d60445f2..ecd849835079f6eaa7114ee7fb8ebb20424adae5 100644 (file)
@@ -147,8 +147,6 @@ extern struct rtx_def *rs6000_float_const PARAMS ((const char *,
 extern int direct_return PARAMS ((void));
 extern int get_issue_rate PARAMS ((void));
 extern union tree_node *rs6000_build_va_list PARAMS ((void));
-extern void rs6000_save_machine_status PARAMS ((struct function *));
-extern void rs6000_restore_machine_status PARAMS ((struct function *));
 extern void rs6000_init_expanders PARAMS ((void));
 extern int first_reg_to_save PARAMS ((void));
 extern int first_fp_reg_to_save PARAMS ((void));
index b980122d2a23023283001fbc104724fcd6188e4d..bb4879382aa4b2caf56b4570b1d14900b12ba1d6 100644 (file)
@@ -89,9 +89,6 @@ const char *rs6000_sdata_name = (char *)0;
 int fixuplabelno = 0;
 #endif
 
-/* Whether a System V.4 varargs area was created.  */
-int rs6000_sysv_varargs_p;
-
 /* ABI enumeration available for subtarget to use.  */
 enum rs6000_abi rs6000_current_abi;
 
@@ -2221,7 +2218,7 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
       /* Indicate to allocate space on the stack for varargs save area.  */
       /* ??? Does this really have to be located at a magic spot on the
         stack, or can we allocate this with assign_stack_local instead.  */
-      rs6000_sysv_varargs_p = 1;
+      cfun->machine->sysv_varargs_p = 1;
       if (! no_rtl)
        save_area = plus_constant (virtual_stack_vars_rtx,
                                   - RS6000_VARARGS_SIZE);
@@ -2231,7 +2228,7 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
   else
     {
       save_area = virtual_incoming_args_rtx;
-      rs6000_sysv_varargs_p = 0;
+      cfun->machine->sysv_varargs_p = 0;
 
       first_reg_offset = cum->words;
       if (MUST_PASS_IN_STACK (mode, type))
@@ -3620,50 +3617,39 @@ rs6000_got_register (value)
   return pic_offset_table_rtx;
 }
 \f
-/* Define the structure for the machine field in struct function.  */
-struct machine_function
-{
-  int sysv_varargs_p;
-};
-
 /* Functions to save and restore sysv_varargs_p.
    These will be called, via pointer variables,
    from push_function_context and pop_function_context.  */
 
-void
-rs6000_save_machine_status (p)
+static void
+rs6000_init_machine_status (p)
      struct function *p;
 {
-  struct machine_function *machine =
-    (struct machine_function *) xmalloc (sizeof (struct machine_function));
+  p->machine = (machine_function *) xmalloc (sizeof (machine_function));
 
-  p->machine = machine;
-  machine->sysv_varargs_p = rs6000_sysv_varargs_p;
+  p->machine->sysv_varargs_p = 0;
 }
 
-void
-rs6000_restore_machine_status (p)
+static void
+rs6000_free_machine_status (p)
      struct function *p;
 {
-  struct machine_function *machine = p->machine;
-
-  rs6000_sysv_varargs_p = machine->sysv_varargs_p;
+  if (p->machine == NULL)
+    return;
 
-  free (machine);
-  p->machine = (struct machine_function *)0;
+  free (p->machine);
+  p->machine = NULL;
 }
 
+
 /* Do anything needed before RTL is emitted for each function.  */
 
 void
 rs6000_init_expanders ()
 {
-  /* Reset varargs */
-  rs6000_sysv_varargs_p = 0;
-
   /* Arrange to save and restore machine status around nested functions.  */
-  save_machine_status = rs6000_save_machine_status;
-  restore_machine_status = rs6000_restore_machine_status;
+  init_machine_status = rs6000_init_machine_status;
+  free_machine_status = rs6000_free_machine_status;
 }
 
 \f
index d6c24aacb8f15f9300ce68f1f121d4d67361f784..27079b3944c5bbd8c4499c8658f913b331de4f84 100644 (file)
@@ -1226,9 +1226,6 @@ typedef struct rs6000_stack {
 /* Size of the V.4 varargs area if needed */
 #define RS6000_VARARGS_AREA 0
 
-/* Whether a V.4 varargs area is needed */
-extern int rs6000_sysv_varargs_p;
-
 /* Align an address */
 #define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1))
 
@@ -1385,6 +1382,14 @@ extern int rs6000_sysv_varargs_p;
    || ((unsigned)((N) - FP_ARG_MIN_REG) < (unsigned)(FP_ARG_NUM_REG)))
 
 \f
+/* A C structure for machine-specific, per-function data.
+   This is added to the cfun structure.  */
+typedef struct machine_function
+{
+  /* Whether a System V.4 varargs area was created.  */
+  int sysv_varargs_p;
+} machine_function;
+
 /* Define a data type for recording info about an argument list
    during the scan of that argument list.  This data type should
    hold all necessary information about the function itself
index bc6e1d6b4f8b381c6c654fbc15b7f91b8d1b2f4e..3172d99be398101f09a322cb41e9c48a94a5d09d 100644 (file)
@@ -312,7 +312,7 @@ do {                                                                        \
 /* Size of the V.4 varargs area if needed.  */
 /* Override rs6000.h definition.  */
 #undef RS6000_VARARGS_AREA
-#define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
+#define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
 
 /* Override default big endianism definitions in rs6000.h.  */
 #undef BYTES_BIG_ENDIAN