Commit 61db4608 by Nick Clifton Committed by Nick Clifton

Use init/mark/free machine status functions.

Fix compile time warnings building varasm.o
Define USER_LABEL_PREFIX, undefine ASM_OUTPUT_LABELREF

From-SVN: r38815
parent 4a70b13a
2001-01-08 Nick Clifton <nickc@redhat.com>
* config/v850/v850.c (ra_rtx): Delete.
(v850_save_machine_status): Delete.
(v850_restore_machine_status): Delete.
(v850_init_machine_status): New function.
(v850_mark_machine_status): New function.
(v850_free_machine_status): New function.
(v850_return_addr): Use ra_rtx field in machine structure.
(v850_init_expanders): Use new functions.
* config/v850/v850-protos.h: Fix prototypes for v850_output_*
* config/v850/v850.c: Change arguments to v850_output+* functions
to take a const char *, to avoid compile time warning.
* config/v850/v850.h (ASM_OUTPUT_LABELREF): Undefine, not needed.
(USER_LABEL_PREFIX): Redefine.
2000-01-08 Jim Wilson <wilson@redhat.com> 2000-01-08 Jim Wilson <wilson@redhat.com>
* sched-rgn.c (BITSET_ADD, BITSET_REMOVE, bitset_member): Cast * sched-rgn.c (BITSET_ADD, BITSET_REMOVE, bitset_member): Cast
......
...@@ -76,9 +76,9 @@ extern int v850_valid_machine_decl_attribute PARAMS ((tree, tree, tree)); ...@@ -76,9 +76,9 @@ extern int v850_valid_machine_decl_attribute PARAMS ((tree, tree, tree));
extern void v850_encode_data_area PARAMS ((tree)); extern void v850_encode_data_area PARAMS ((tree));
extern void v850_set_default_decl_attr PARAMS ((tree)); extern void v850_set_default_decl_attr PARAMS ((tree));
extern int v850_interrupt_function_p PARAMS ((tree)); extern int v850_interrupt_function_p PARAMS ((tree));
extern void v850_output_aligned_bss PARAMS ((FILE *, tree, char *, int, int)); extern void v850_output_aligned_bss PARAMS ((FILE *, tree, const char *, int, int));
extern void v850_output_common PARAMS ((FILE *, tree, char *, int, int)); extern void v850_output_common PARAMS ((FILE *, tree, const char *, int, int));
extern void v850_output_local PARAMS ((FILE *, tree, char *, int, int)); extern void v850_output_local PARAMS ((FILE *, tree, const char *, int, int));
extern v850_data_area v850_get_data_area PARAMS ((tree)); extern v850_data_area v850_get_data_area PARAMS ((tree));
#ifdef HAVE_MACHINE_MODES #ifdef HAVE_MACHINE_MODES
extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int)); extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int));
......
...@@ -47,14 +47,14 @@ Boston, MA 02111-1307, USA. */ ...@@ -47,14 +47,14 @@ Boston, MA 02111-1307, USA. */
#endif #endif
/* Function prototypes for stupid compilers: */ /* Function prototypes for stupid compilers: */
static void const_double_split static void const_double_split PARAMS ((rtx, HOST_WIDE_INT *, HOST_WIDE_INT *));
PARAMS ((rtx, HOST_WIDE_INT *, HOST_WIDE_INT *)); static int const_costs_int PARAMS ((HOST_WIDE_INT, int));
static int const_costs_int PARAMS ((HOST_WIDE_INT, int)); static void substitute_ep_register PARAMS ((rtx, rtx, int, int, rtx *, rtx *));
static void substitute_ep_register PARAMS ((rtx, rtx, int, int, rtx *, rtx *)); static int ep_memory_offset PARAMS ((enum machine_mode, int));
static int ep_memory_offset PARAMS ((enum machine_mode, int)); static void v850_set_data_area PARAMS ((tree, v850_data_area));
static void v850_set_data_area PARAMS ((tree, v850_data_area)); static void v850_init_machine_status PARAMS ((struct function *));
static void v850_save_machine_status PARAMS ((struct function *)); static void v850_mark_machine_status PARAMS ((struct function *));
static void v850_restore_machine_status PARAMS ((struct function *)); static void v850_free_machine_status PARAMS ((struct function *));
/* True if the current function has anonymous arguments. */ /* True if the current function has anonymous arguments. */
int current_function_anonymous_args; int current_function_anonymous_args;
...@@ -1153,7 +1153,7 @@ Saved %d bytes (%d uses of register %s) in function %s, starting as insn %d, end ...@@ -1153,7 +1153,7 @@ Saved %d bytes (%d uses of register %s) in function %s, starting as insn %d, end
as a C statement to act on the code starting at INSN. as a C statement to act on the code starting at INSN.
On the 850, we use it to implement the -mep mode to copy heavily used On the 850, we use it to implement the -mep mode to copy heavily used
pointers to ep to use the implicit addressing */ pointers to ep to use the implicit addressing. */
void v850_reorg (start_insn) void v850_reorg (start_insn)
rtx start_insn; rtx start_insn;
...@@ -1173,7 +1173,7 @@ void v850_reorg (start_insn) ...@@ -1173,7 +1173,7 @@ void v850_reorg (start_insn)
rtx insn; rtx insn;
rtx pattern; rtx pattern;
/* If not ep mode, just return now */ /* If not ep mode, just return now. */
if (!TARGET_EP) if (!TARGET_EP)
return; return;
...@@ -2556,7 +2556,7 @@ void ...@@ -2556,7 +2556,7 @@ void
v850_output_aligned_bss (file, decl, name, size, align) v850_output_aligned_bss (file, decl, name, size, align)
FILE * file; FILE * file;
tree decl; tree decl;
char * name; const char * name;
int size; int size;
int align; int align;
{ {
...@@ -2596,7 +2596,7 @@ void ...@@ -2596,7 +2596,7 @@ void
v850_output_common (file, decl, name, size, align) v850_output_common (file, decl, name, size, align)
FILE * file; FILE * file;
tree decl; tree decl;
char * name; const char * name;
int size; int size;
int align; int align;
{ {
...@@ -2635,7 +2635,7 @@ void ...@@ -2635,7 +2635,7 @@ void
v850_output_local (file, decl, name, size, align) v850_output_local (file, decl, name, size, align)
FILE * file; FILE * file;
tree decl; tree decl;
char * name; const char * name;
int size; int size;
int align; int align;
{ {
...@@ -2788,9 +2788,6 @@ v850_va_arg (valist, type) ...@@ -2788,9 +2788,6 @@ v850_va_arg (valist, type)
} }
/* Functions to save and restore machine-specific function data. */ /* Functions to save and restore machine-specific function data. */
static rtx ra_rtx;
struct machine_function struct machine_function
{ {
/* Records __builtin_return address. */ /* Records __builtin_return address. */
...@@ -2798,19 +2795,24 @@ struct machine_function ...@@ -2798,19 +2795,24 @@ struct machine_function
}; };
static void static void
v850_save_machine_status (p) v850_init_machine_status (p)
struct function * p; struct function * p;
{ {
p->machine = p->machine =
(struct machine_function *) xcalloc (1, sizeof (struct machine_function)); (struct machine_function *) xcalloc (1, sizeof (struct machine_function));
p->machine->ra_rtx = ra_rtx;
} }
static void static void
v850_restore_machine_status (p) 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; struct function * p;
{ {
ra_rtx = p->machine->ra_rtx;
free (p->machine); free (p->machine);
p->machine = NULL; p->machine = NULL;
} }
...@@ -2825,17 +2827,17 @@ v850_return_addr (count) ...@@ -2825,17 +2827,17 @@ v850_return_addr (count)
if (count != 0) if (count != 0)
return const0_rtx; return const0_rtx;
if (ra_rtx == NULL) if (cfun->machine->ra_rtx == NULL)
{ {
rtx init; rtx init;
/* No rtx yet. Invent one, and initialize it for r31 (lp) in /* No rtx yet. Invent one, and initialize it for r31 (lp) in
the prologue. */ the prologue. */
ra_rtx = gen_reg_rtx (Pmode); cfun->machine->ra_rtx = gen_reg_rtx (Pmode);
init = gen_rtx_REG (Pmode, LINK_POINTER_REGNUM); init = gen_rtx_REG (Pmode, LINK_POINTER_REGNUM);
init = gen_rtx_SET (VOIDmode, ra_rtx, init); init = gen_rtx_SET (VOIDmode, cfun->machine->ra_rtx, init);
/* Emit the insn to the prologue with the other argument copies. */ /* Emit the insn to the prologue with the other argument copies. */
push_topmost_sequence (); push_topmost_sequence ();
...@@ -2843,8 +2845,7 @@ v850_return_addr (count) ...@@ -2843,8 +2845,7 @@ v850_return_addr (count)
pop_topmost_sequence (); pop_topmost_sequence ();
} }
debug_rtx (ra_rtx); return cfun->machine->ra_rtx;
return ra_rtx;
} }
/* Do anything needed before RTL is emitted for each function. */ /* Do anything needed before RTL is emitted for each function. */
...@@ -2852,8 +2853,7 @@ v850_return_addr (count) ...@@ -2852,8 +2853,7 @@ v850_return_addr (count)
void void
v850_init_expanders () v850_init_expanders ()
{ {
ra_rtx = NULL; init_machine_status = v850_init_machine_status;
mark_machine_status = v850_mark_machine_status;
save_machine_status = v850_save_machine_status; free_machine_status = v850_free_machine_status;
restore_machine_status = v850_restore_machine_status;
} }
...@@ -1262,6 +1262,9 @@ do { \ ...@@ -1262,6 +1262,9 @@ do { \
#define ASM_APP_OFF "#NO_APP\n" #define ASM_APP_OFF "#NO_APP\n"
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
/* This is how to output an assembler line defining a `double' constant. /* This is how to output an assembler line defining a `double' constant.
It is .double or .float, depending. */ It is .double or .float, depending. */
...@@ -1341,19 +1344,15 @@ do { char dstr[30]; \ ...@@ -1341,19 +1344,15 @@ do { char dstr[30]; \
/* This is how to output a command to make the user-level label named NAME /* This is how to output a command to make the user-level label named NAME
defined for reference from other files. */ defined for reference from other files. */
#define ASM_GLOBALIZE_LABEL(FILE, NAME) \ #define ASM_GLOBALIZE_LABEL(FILE, NAME) \
do { fputs ("\t.global ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0) do \
{ \
/* This is how to output a reference to a user-level label named NAME. fputs ("\t.global ", FILE); \
`assemble_name' uses this. */ assemble_name (FILE, NAME); \
fputs ("\n", FILE); \
} \
while (0)
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
do { \
const char * real_name; \
STRIP_NAME_ENCODING (real_name, (NAME)); \
fprintf (FILE, "_%s", real_name); \
} while (0)
/* Store in OUTPUT a string (made with alloca) containing /* Store in OUTPUT a string (made with alloca) containing
an assembler-name for a local static variable named NAME. an assembler-name for a local static variable named NAME.
...@@ -1608,11 +1607,11 @@ extern union tree_node * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_K ...@@ -1608,11 +1607,11 @@ extern union tree_node * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_K
#define SDA_NAME_P(NAME) (*(NAME) == SDA_NAME_FLAG_CHAR) #define SDA_NAME_P(NAME) (*(NAME) == SDA_NAME_FLAG_CHAR)
#define ENCODED_NAME_P(SYMBOL_NAME) \ #define ENCODED_NAME_P(SYMBOL_NAME) \
(ZDA_NAME_P (SYMBOL_NAME) \ ( ZDA_NAME_P (SYMBOL_NAME) \
|| TDA_NAME_P (SYMBOL_NAME) \ || TDA_NAME_P (SYMBOL_NAME) \
|| SDA_NAME_P (SYMBOL_NAME)) || SDA_NAME_P (SYMBOL_NAME))
#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \ #define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
(VAR) = (SYMBOL_NAME) + (ENCODED_NAME_P (SYMBOL_NAME) || *(SYMBOL_NAME) == '*') (VAR) = (SYMBOL_NAME) + (ENCODED_NAME_P (SYMBOL_NAME) || *(SYMBOL_NAME) == '*')
/* Define this if you have defined special-purpose predicates in the /* Define this if you have defined special-purpose predicates in the
......
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