diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c07caf0c7d..c0279fe07ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2001-01-08 Nick Clifton + + * 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 * sched-rgn.c (BITSET_ADD, BITSET_REMOVE, bitset_member): Cast diff --git a/gcc/config/v850/v850-protos.h b/gcc/config/v850/v850-protos.h index f0b7b4ed27f..8bc38711961 100644 --- a/gcc/config/v850/v850-protos.h +++ b/gcc/config/v850/v850-protos.h @@ -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_set_default_decl_attr 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_common PARAMS ((FILE *, tree, char *, int, int)); -extern void v850_output_local 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, const 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)); #ifdef HAVE_MACHINE_MODES extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int)); diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 86c7144206c..ffc2a2474de 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -47,14 +47,14 @@ Boston, MA 02111-1307, USA. */ #endif /* Function prototypes for stupid compilers: */ -static void const_double_split - PARAMS ((rtx, HOST_WIDE_INT *, HOST_WIDE_INT *)); -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_save_machine_status PARAMS ((struct function *)); -static void v850_restore_machine_status PARAMS ((struct function *)); +static void const_double_split PARAMS ((rtx, HOST_WIDE_INT *, HOST_WIDE_INT *)); +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; @@ -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. 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) rtx start_insn; @@ -1173,7 +1173,7 @@ void v850_reorg (start_insn) rtx insn; rtx pattern; - /* If not ep mode, just return now */ + /* If not ep mode, just return now. */ if (!TARGET_EP) return; @@ -2556,7 +2556,7 @@ void v850_output_aligned_bss (file, decl, name, size, align) FILE * file; tree decl; - char * name; + const char * name; int size; int align; { @@ -2596,7 +2596,7 @@ void v850_output_common (file, decl, name, size, align) FILE * file; tree decl; - char * name; + const char * name; int size; int align; { @@ -2635,7 +2635,7 @@ void v850_output_local (file, decl, name, size, align) FILE * file; tree decl; - char * name; + const char * name; int size; int align; { @@ -2788,9 +2788,6 @@ v850_va_arg (valist, type) } /* Functions to save and restore machine-specific function data. */ - -static rtx ra_rtx; - struct machine_function { /* Records __builtin_return address. */ @@ -2798,19 +2795,24 @@ struct machine_function }; static void -v850_save_machine_status (p) +v850_init_machine_status (p) struct function * p; { p->machine = (struct machine_function *) xcalloc (1, sizeof (struct machine_function)); - p->machine->ra_rtx = ra_rtx; } 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; { - ra_rtx = p->machine->ra_rtx; free (p->machine); p->machine = NULL; } @@ -2825,17 +2827,17 @@ v850_return_addr (count) if (count != 0) return const0_rtx; - if (ra_rtx == NULL) + if (cfun->machine->ra_rtx == NULL) { rtx init; /* No rtx yet. Invent one, and initialize it for r31 (lp) in 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_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. */ push_topmost_sequence (); @@ -2843,8 +2845,7 @@ v850_return_addr (count) pop_topmost_sequence (); } - debug_rtx (ra_rtx); - return ra_rtx; + return cfun->machine->ra_rtx; } /* Do anything needed before RTL is emitted for each function. */ @@ -2852,8 +2853,7 @@ v850_return_addr (count) void v850_init_expanders () { - ra_rtx = NULL; - - save_machine_status = v850_save_machine_status; - restore_machine_status = v850_restore_machine_status; + init_machine_status = v850_init_machine_status; + mark_machine_status = v850_mark_machine_status; + free_machine_status = v850_free_machine_status; } diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index 36bce1a84bb..3c364b8a89d 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -1262,6 +1262,9 @@ do { \ #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. It is .double or .float, depending. */ @@ -1341,19 +1344,15 @@ do { char dstr[30]; \ /* This is how to output a command to make the user-level label named NAME defined for reference from other files. */ -#define ASM_GLOBALIZE_LABEL(FILE, NAME) \ - do { fputs ("\t.global ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0) +#define ASM_GLOBALIZE_LABEL(FILE, NAME) \ + do \ + { \ + fputs ("\t.global ", FILE); \ + assemble_name (FILE, NAME); \ + fputs ("\n", FILE); \ + } \ + while (0) -/* This is how to output a reference to a user-level label named NAME. - `assemble_name' uses this. */ - -#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 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 #define SDA_NAME_P(NAME) (*(NAME) == SDA_NAME_FLAG_CHAR) #define ENCODED_NAME_P(SYMBOL_NAME) \ - (ZDA_NAME_P (SYMBOL_NAME) \ + ( ZDA_NAME_P (SYMBOL_NAME) \ || TDA_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) == '*') /* Define this if you have defined special-purpose predicates in the