aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@gcc.gnu.org>2001-01-09 19:38:25 +0000
committerNick Clifton <nickc@gcc.gnu.org>2001-01-09 19:38:25 +0000
commit00dba523ac47a86a2778a59dc610f1b60d8995f8 (patch)
tree78de2ff5038e4fdc8060140a15c07600411d854f
parent6e2d9a7aab54522a9ad1e146339a266f1f41f91e (diff)
downloadgcc-00dba523ac47a86a2778a59dc610f1b60d8995f8.zip
gcc-00dba523ac47a86a2778a59dc610f1b60d8995f8.tar.gz
gcc-00dba523ac47a86a2778a59dc610f1b60d8995f8.tar.bz2
oops - omitted from previous delta
From-SVN: r38838
-rw-r--r--gcc/config/rs6000/rs6000-protos.h2
-rw-r--r--gcc/config/rs6000/rs6000.c44
-rw-r--r--gcc/config/rs6000/rs6000.h11
-rw-r--r--gcc/config/rs6000/sysv4.h2
4 files changed, 24 insertions, 35 deletions
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 38b35de..ecd8498 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -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));
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index b980122..bb48793 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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;
}
-/* 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;
}
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index d6c24aa..27079b3 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -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)))
+/* 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
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index bc6e1d6..3172d99 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -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