Commit 00dba523 by Nick Clifton

oops - omitted from previous delta

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