varasm.c (function_defined): Remove.

1999-11-22  Andrew Haley  <aph@cygnus.com>

        * varasm.c (function_defined): Remove.
        (make_function_rtl): Don't set function_defined.
        (make_decl_rtl): Remove global register warning.
        * regclass.c (no_global_reg_vars): New variable.
        (globalize_reg): Warn if function has already been defined.
        (regclass_init): Set no_global_reg_vars.

From-SVN: r30611
This commit is contained in:
Andrew Haley 1999-11-22 14:20:35 +00:00 committed by Andrew Haley
parent 9ffc5a70f8
commit 6c85df6949
3 changed files with 20 additions and 10 deletions

View File

@ -1,3 +1,12 @@
1999-11-22 Andrew Haley <aph@cygnus.com>
* varasm.c (function_defined): Remove.
(make_function_rtl): Don't set function_defined.
(make_decl_rtl): Remove global register warning.
* regclass.c (no_global_reg_vars): New variable.
(globalize_reg): Warn if function has already been defined.
(regclass_init): Set no_global_reg_vars.
Mon Nov 22 14:42:22 MET 1999 Jan Hubicka <hubicka@freesoft.cz>
* regclass.c (reg_pref): New structure and static variable

View File

@ -218,6 +218,11 @@ struct reg_info_data {
static struct reg_info_data *reg_info_head;
/* No more global register vairiables may be declared; true once
regclass has been initialized. */
static int no_global_reg_vars = 0;
/* Function called only once to initialize the above data on reg usage.
Once this is done, various switches may override. */
@ -625,6 +630,9 @@ void
globalize_reg (i)
int i;
{
if (no_global_reg_vars)
error ("global register variable follows a function definition");
if (global_regs[i])
{
warning ("register used for two global register variables");
@ -758,6 +766,9 @@ regclass_init ()
/* This prevents dump_flow_info from losing if called
before regclass is run. */
reg_pref = NULL;
/* No more global register vairiables may be declared. */
no_global_reg_vars = 1;
}
/* Dump register costs. */

View File

@ -149,10 +149,6 @@ int size_directive_output;
tree last_assemble_variable_decl;
/* Nonzero if at least one function definition has been seen. */
static int function_defined;
static const char *strip_reg_name PROTO((const char *));
static int contains_pointers_p PROTO((tree));
static void decode_addr_const PROTO((tree, struct addr_const *));
@ -579,9 +575,6 @@ make_function_rtl (decl)
ENCODE_SECTION_INFO (decl);
#endif
}
/* Record at least one function has been defined. */
function_defined = 1;
}
/* Given NAME, a putative register name, discard any customary prefixes. */
@ -729,9 +722,6 @@ make_decl_rtl (decl, asmspec, top_level)
DECL_INITIAL (decl) = 0;
error ("global register variable has initial value");
}
if (fixed_regs[reg_number] == 0
&& function_defined && top_level)
error ("global register variable follows a function definition");
if (TREE_THIS_VOLATILE (decl))
warning ("volatile register variables don't work as you might wish");