gcc.c: Convert prototypes to ISO C90.

* gcc.c: Convert prototypes to ISO C90.
	* gcc.h: Likewise.
	* gcov-dump.c: Likewise.
	* gcov-iov.c: Likewise.
	* gcse.c: Likewise.
	* genattrtab.h: Likewise.
	* ggc.h: Likewise.
	* global.c: Likewise.
	* graph.c: Likewise.
	* graph.h: Likewise.
	* hosthooks.h: Likewise.
	* hooks.h: Likewise.
	* hooks.c: Likewise.
	* hashtable.h: Likewise.
	* hashtable.c: Likewise.
	* haifa-sched.c: Likewise.
	* integrate.h: Likewise.
	* integrate.c: Likewise.
	* input.h: Likewise.
	* ifcvt.c: Likewise.

From-SVN: r68995
This commit is contained in:
Andreas Jaeger 2003-07-06 08:15:36 +02:00 committed by Andreas Jaeger
parent 481668695a
commit 1d088deebe
20 changed files with 1040 additions and 1644 deletions

View File

@ -1,3 +1,26 @@
2003-07-06 Andreas Jaeger <aj@suse.de>
* gcc.c: Convert prototypes to ISO C90.
* gcc.h: Likewise.
* gcov-dump.c: Likewise.
* gcov-iov.c: Likewise.
* gcse.c: Likewise.
* genattrtab.h: Likewise.
* ggc.h: Likewise.
* global.c: Likewise.
* graph.c: Likewise.
* graph.h: Likewise.
* hosthooks.h: Likewise.
* hooks.h: Likewise.
* hooks.c: Likewise.
* hashtable.h: Likewise.
* hashtable.c: Likewise.
* haifa-sched.c: Likewise.
* integrate.h: Likewise.
* integrate.c: Likewise.
* input.h: Likewise.
* ifcvt.c: Likewise.
2003-07-05 Kazu Hirata <kazu@cs.umass.edu>
* combine.c (nonzero_bits1): Fix a warning.

451
gcc/gcc.c
View File

@ -88,7 +88,7 @@ compilation is specified by a string called a "spec". */
#include <sys/resource.h>
#endif
#if defined (HAVE_DECL_GETRUSAGE) && !HAVE_DECL_GETRUSAGE
extern int getrusage PARAMS ((int, struct rusage *));
extern int getrusage (int, struct rusage *);
#endif
/* By default there is no special suffix for target executables. */
@ -286,82 +286,74 @@ static struct rusage rus, prus;
/* Forward declaration for prototypes. */
struct path_prefix;
static void init_spec PARAMS ((void));
static void store_arg PARAMS ((const char *, int, int));
static char *load_specs PARAMS ((const char *));
static void read_specs PARAMS ((const char *, int));
static void set_spec PARAMS ((const char *, const char *));
static struct compiler *lookup_compiler PARAMS ((const char *, size_t, const char *));
static char *build_search_list PARAMS ((struct path_prefix *, const char *, int));
static void putenv_from_prefixes PARAMS ((struct path_prefix *, const char *));
static int access_check PARAMS ((const char *, int));
static char *find_a_file PARAMS ((struct path_prefix *, const char *,
int, int));
static void add_prefix PARAMS ((struct path_prefix *, const char *,
const char *, int, int, int *, int));
static void add_sysrooted_prefix PARAMS ((struct path_prefix *, const char *,
const char *, int, int, int *, int));
static void translate_options PARAMS ((int *, const char *const **));
static char *skip_whitespace PARAMS ((char *));
static void delete_if_ordinary PARAMS ((const char *));
static void delete_temp_files PARAMS ((void));
static void delete_failure_queue PARAMS ((void));
static void clear_failure_queue PARAMS ((void));
static int check_live_switch PARAMS ((int, int));
static const char *handle_braces PARAMS ((const char *));
static inline bool input_suffix_matches PARAMS ((const char *,
const char *));
static inline bool switch_matches PARAMS ((const char *,
const char *, int));
static inline void mark_matching_switches PARAMS ((const char *,
const char *, int));
static inline void process_marked_switches PARAMS ((void));
static const char *process_brace_body PARAMS ((const char *, const char *,
const char *, int, int));
static const struct spec_function *lookup_spec_function PARAMS ((const char *));
static const char *eval_spec_function PARAMS ((const char *, const char *));
static const char *handle_spec_function PARAMS ((const char *));
static char *save_string PARAMS ((const char *, int));
static void set_collect_gcc_options PARAMS ((void));
static int do_spec_1 PARAMS ((const char *, int, const char *));
static int do_spec_2 PARAMS ((const char *));
static void do_option_spec PARAMS ((const char *, const char *));
static void do_self_spec PARAMS ((const char *));
static const char *find_file PARAMS ((const char *));
static int is_directory PARAMS ((const char *, const char *, int));
static const char *validate_switches PARAMS ((const char *));
static void validate_all_switches PARAMS ((void));
static inline void validate_switches_from_spec PARAMS ((const char *));
static void give_switch PARAMS ((int, int));
static int used_arg PARAMS ((const char *, int));
static int default_arg PARAMS ((const char *, int));
static void set_multilib_dir PARAMS ((void));
static void print_multilib_info PARAMS ((void));
static void perror_with_name PARAMS ((const char *));
static void pfatal_pexecute PARAMS ((const char *, const char *))
ATTRIBUTE_NORETURN;
static void notice PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1;
static void display_help PARAMS ((void));
static void add_preprocessor_option PARAMS ((const char *, int));
static void add_assembler_option PARAMS ((const char *, int));
static void add_linker_option PARAMS ((const char *, int));
static void process_command PARAMS ((int, const char *const *));
static int execute PARAMS ((void));
static void alloc_args PARAMS ((void));
static void clear_args PARAMS ((void));
static void fatal_error PARAMS ((int));
static void init_spec (void);
static void store_arg (const char *, int, int);
static char *load_specs (const char *);
static void read_specs (const char *, int);
static void set_spec (const char *, const char *);
static struct compiler *lookup_compiler (const char *, size_t, const char *);
static char *build_search_list (struct path_prefix *, const char *, int);
static void putenv_from_prefixes (struct path_prefix *, const char *);
static int access_check (const char *, int);
static char *find_a_file (struct path_prefix *, const char *, int, int);
static void add_prefix (struct path_prefix *, const char *, const char *,
int, int, int *, int);
static void add_sysrooted_prefix (struct path_prefix *, const char *,
const char *, int, int, int *, int);
static void translate_options (int *, const char *const **);
static char *skip_whitespace (char *);
static void delete_if_ordinary (const char *);
static void delete_temp_files (void);
static void delete_failure_queue (void);
static void clear_failure_queue (void);
static int check_live_switch (int, int);
static const char *handle_braces (const char *);
static inline bool input_suffix_matches (const char *, const char *);
static inline bool switch_matches (const char *, const char *, int);
static inline void mark_matching_switches (const char *, const char *, int);
static inline void process_marked_switches (void);
static const char *process_brace_body (const char *, const char *, const char *, int, int);
static const struct spec_function *lookup_spec_function (const char *);
static const char *eval_spec_function (const char *, const char *);
static const char *handle_spec_function (const char *);
static char *save_string (const char *, int);
static void set_collect_gcc_options (void);
static int do_spec_1 (const char *, int, const char *);
static int do_spec_2 (const char *);
static void do_option_spec (const char *, const char *);
static void do_self_spec (const char *);
static const char *find_file (const char *);
static int is_directory (const char *, const char *, int);
static const char *validate_switches (const char *);
static void validate_all_switches (void);
static inline void validate_switches_from_spec (const char *);
static void give_switch (int, int);
static int used_arg (const char *, int);
static int default_arg (const char *, int);
static void set_multilib_dir (void);
static void print_multilib_info (void);
static void perror_with_name (const char *);
static void pfatal_pexecute (const char *, const char *) ATTRIBUTE_NORETURN;
static void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
static void display_help (void);
static void add_preprocessor_option (const char *, int);
static void add_assembler_option (const char *, int);
static void add_linker_option (const char *, int);
static void process_command (int, const char *const *);
static int execute (void);
static void alloc_args (void);
static void clear_args (void);
static void fatal_error (int);
#ifdef ENABLE_SHARED_LIBGCC
static void init_gcc_specs PARAMS ((struct obstack *,
const char *, const char *,
const char *));
static void init_gcc_specs (struct obstack *, const char *, const char *,
const char *);
#endif
#if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
static const char *convert_filename PARAMS ((const char *, int, int));
static const char *convert_filename (const char *, int, int);
#endif
static const char *if_exists_spec_function PARAMS ((int, const char **));
static const char *if_exists_else_spec_function PARAMS ((int, const char **));
static const char *if_exists_spec_function (int, const char **);
static const char *if_exists_else_spec_function (int, const char **);
/* The Specs Language
@ -503,9 +495,9 @@ or with constant text in a single argument.
name starts with `o'. %{o*} would substitute this text,
including the space; thus, two arguments would be generated.
%{S*&T*} likewise, but preserve order of S and T options (the order
of S and T in the spec is not significant). Can be any number
of ampersand-separated variables; for each the wild card is
optional. Useful for CPP as %{D*&U*&A*}.
of S and T in the spec is not significant). Can be any number
of ampersand-separated variables; for each the wild card is
optional. Useful for CPP as %{D*&U*&A*}.
%{S:X} substitutes X, if the -S switch was given to CC.
%{!S:X} substitutes X, if the -S switch was NOT given to CC.
@ -958,7 +950,7 @@ static const struct compiler default_compilers[] =
as %(asm_debug) %(asm_options) %m.s %A }}}}"
#endif
, 0},
#include "specs.h"
/* Mark end of table. */
{0, 0, 0}
@ -1109,9 +1101,7 @@ static const struct {
and store its length in *ARGVC. */
static void
translate_options (argcp, argvp)
int *argcp;
const char *const **argvp;
translate_options (int *argcp, const char *const **argvp)
{
int i;
int argc = *argcp;
@ -1321,8 +1311,7 @@ translate_options (argcp, argvp)
}
static char *
skip_whitespace (p)
char *p;
skip_whitespace (char *p)
{
while (1)
{
@ -1546,11 +1535,8 @@ static int processing_spec_function;
#ifdef ENABLE_SHARED_LIBGCC
static void
init_gcc_specs (obstack, shared_name, static_name, eh_name)
struct obstack *obstack;
const char *shared_name;
const char *static_name;
const char *eh_name;
init_gcc_specs (struct obstack *obstack, const char *shared_name,
const char *static_name, const char *eh_name)
{
char *buf;
@ -1719,9 +1705,7 @@ init_spec ()
current spec. */
static void
set_spec (name, spec)
const char *name;
const char *spec;
set_spec (const char *name, const char *spec)
{
struct spec_list *sl;
const char *old_spec;
@ -1827,7 +1811,7 @@ alloc_args ()
/* Clear out the vector of arguments (after a command is executed). */
static void
clear_args ()
clear_args (void)
{
argbuf_index = 0;
}
@ -1840,9 +1824,7 @@ clear_args ()
and the file should be deleted if this compilation fails. */
static void
store_arg (arg, delete_always, delete_failure)
const char *arg;
int delete_always, delete_failure;
store_arg (const char *arg, int delete_always, int delete_failure)
{
if (argbuf_index + 1 == argbuf_length)
argbuf
@ -1861,8 +1843,7 @@ store_arg (arg, delete_always, delete_failure)
a single \n. */
static char *
load_specs (filename)
const char *filename;
load_specs (const char *filename)
{
int desc;
int readlen;
@ -1926,9 +1907,7 @@ load_specs (filename)
Anything invalid in the file is a fatal error. */
static void
read_specs (filename, main_p)
const char *filename;
int main_p;
read_specs (const char *filename, int main_p)
{
char *buffer;
char *p;
@ -2198,10 +2177,7 @@ static struct temp_file *failure_delete_queue;
otherwise delete it in any case. */
void
record_temp_file (filename, always_delete, fail_delete)
const char *filename;
int always_delete;
int fail_delete;
record_temp_file (const char *filename, int always_delete, int fail_delete)
{
char *const name = xstrdup (filename);
@ -2239,8 +2215,7 @@ record_temp_file (filename, always_delete, fail_delete)
/* Delete all the temporary files whose names we previously recorded. */
static void
delete_if_ordinary (name)
const char *name;
delete_if_ordinary (const char *name)
{
struct stat st;
#ifdef DEBUG
@ -2262,7 +2237,7 @@ delete_if_ordinary (name)
}
static void
delete_temp_files ()
delete_temp_files (void)
{
struct temp_file *temp;
@ -2274,7 +2249,7 @@ delete_temp_files ()
/* Delete all the files to be deleted on error. */
static void
delete_failure_queue ()
delete_failure_queue (void)
{
struct temp_file *temp;
@ -2283,7 +2258,7 @@ delete_failure_queue ()
}
static void
clear_failure_queue ()
clear_failure_queue (void)
{
failure_delete_queue = 0;
}
@ -2295,10 +2270,8 @@ clear_failure_queue ()
It is also used by the --print-search-dirs flag. */
static char *
build_search_list (paths, prefix, check_dir_p)
struct path_prefix *paths;
const char *prefix;
int check_dir_p;
build_search_list (struct path_prefix *paths, const char *prefix,
int check_dir_p)
{
int suffix_len = (machine_suffix) ? strlen (machine_suffix) : 0;
int just_suffix_len
@ -2357,9 +2330,7 @@ build_search_list (paths, prefix, check_dir_p)
for collect. */
static void
putenv_from_prefixes (paths, env_var)
struct path_prefix *paths;
const char *env_var;
putenv_from_prefixes (struct path_prefix *paths, const char *env_var)
{
putenv (build_search_list (paths, env_var, 1));
}
@ -2368,9 +2339,7 @@ putenv_from_prefixes (paths, env_var)
except that it never considers directories to be executable. */
static int
access_check (name, mode)
const char *name;
int mode;
access_check (const char *name, int mode)
{
if (mode == X_OK)
{
@ -2389,10 +2358,8 @@ access_check (name, mode)
Return 0 if not found, otherwise return its name, allocated with malloc. */
static char *
find_a_file (pprefix, name, mode, multilib)
struct path_prefix *pprefix;
const char *name;
int mode, multilib;
find_a_file (struct path_prefix *pprefix, const char *name, int mode,
int multilib)
{
char *temp;
const char *const file_suffix =
@ -2567,15 +2534,9 @@ enum path_prefix_priority
2 means try both machine_suffix and just_machine_suffix. */
static void
add_prefix (pprefix, prefix, component, priority, require_machine_suffix,
warn, os_multilib)
struct path_prefix *pprefix;
const char *prefix;
const char *component;
/* enum prefix_priority */ int priority;
int require_machine_suffix;
int *warn;
int os_multilib;
add_prefix (struct path_prefix *pprefix, const char *prefix,
const char *component, /* enum prefix_priority */ int priority,
int require_machine_suffix, int *warn, int os_multilib)
{
struct prefix_list *pl, **prev;
int len;
@ -2608,15 +2569,10 @@ add_prefix (pprefix, prefix, component, priority, require_machine_suffix,
/* Same as add_prefix, but prepending target_system_root to prefix. */
static void
add_sysrooted_prefix (pprefix, prefix, component, priority,
require_machine_suffix, warn, os_multilib)
struct path_prefix *pprefix;
const char *prefix;
const char *component;
/* enum prefix_priority */ int priority;
int require_machine_suffix;
int *warn;
int os_multilib;
add_sysrooted_prefix (struct path_prefix *pprefix, const char *prefix,
const char *component,
/* enum prefix_priority */ int priority,
int require_machine_suffix, int *warn, int os_multilib)
{
if (!IS_ABSOLUTE_PATH (prefix))
abort ();
@ -2643,7 +2599,7 @@ add_sysrooted_prefix (pprefix, prefix, component, priority,
Return 0 if successful, -1 if failed. */
static int
execute ()
execute (void)
{
int i;
int n_commands; /* # of command. */
@ -2957,10 +2913,8 @@ static int *warn_std_ptr = 0;
is true if we should look for an object suffix. */
static const char *
convert_filename (name, do_exe, do_obj)
const char *name;
int do_exe ATTRIBUTE_UNUSED;
int do_obj ATTRIBUTE_UNUSED;
convert_filename (const char *name, int do_exe ATTRIBUTE_UNUSED,
int do_obj ATTRIBUTE_UNUSED)
{
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
int i;
@ -3010,7 +2964,7 @@ convert_filename (name, do_exe, do_obj)
/* Display the command line switches accepted by gcc. */
static void
display_help ()
display_help (void)
{
printf (_("Usage: %s [options] file...\n"), programname);
fputs (_("Options:\n"), stdout);
@ -3070,9 +3024,7 @@ display_help ()
}
static void
add_preprocessor_option (option, len)
const char *option;
int len;
add_preprocessor_option (const char *option, int len)
{
n_preprocessor_options++;
@ -3089,9 +3041,7 @@ add_preprocessor_option (option, len)
}
static void
add_assembler_option (option, len)
const char *option;
int len;
add_assembler_option (const char *option, int len)
{
n_assembler_options++;
@ -3107,9 +3057,7 @@ add_assembler_option (option, len)
}
static void
add_linker_option (option, len)
const char *option;
int len;
add_linker_option (const char *option, int len)
{
n_linker_options++;
@ -3128,9 +3076,7 @@ add_linker_option (option, len)
Store its length in `n_switches'. */
static void
process_command (argc, argv)
int argc;
const char *const *argv;
process_command (int argc, const char *const *argv)
{
int i;
const char *temp;
@ -3175,7 +3121,7 @@ process_command (argc, argv)
char **new_argv;
char *new_argv0;
int baselen;
while (argc > 1 && argv[1][0] == '-'
&& (argv[1][1] == 'V' || argv[1][1] == 'b'))
{
@ -3204,7 +3150,7 @@ process_command (argc, argv)
for (baselen = strlen (progname); baselen > 0; baselen--)
if (IS_DIR_SEPARATOR (progname[baselen-1]))
break;
new_argv0 = xmemdup (progname, baselen,
new_argv0 = xmemdup (progname, baselen,
baselen + concat_length (new_version, new_machine,
"-gcc-", NULL) + 1);
strcpy (new_argv0 + baselen, new_machine);
@ -3784,7 +3730,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
use_pipes = 0;
}
/* Set up the search paths before we go looking for config files. */
/* These come before the md prefixes so that we will find gcc's subcommands
@ -4120,7 +4066,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
and place that in the environment. */
static void
set_collect_gcc_options ()
set_collect_gcc_options (void)
{
int i;
int first_time;
@ -4225,8 +4171,7 @@ static const char *suffix_subst;
Returns 0 if the spec is successfully processed; -1 if failed. */
int
do_spec (spec)
const char *spec;
do_spec (const char *spec)
{
int value;
@ -4249,8 +4194,7 @@ do_spec (spec)
}
static int
do_spec_2 (spec)
const char *spec;
do_spec_2 (const char *spec)
{
const char *string;
int result;
@ -4286,9 +4230,7 @@ do_spec_2 (spec)
of the switches/n_switches array. */
static void
do_option_spec (name, spec)
const char *name;
const char *spec;
do_option_spec (const char *name, const char *spec)
{
unsigned int i, value_count, value_len;
const char *p, *q, *value;
@ -4337,8 +4279,7 @@ do_option_spec (name, spec)
of the switches/n_switches array. */
static void
do_self_spec (spec)
const char *spec;
do_self_spec (const char *spec)
{
do_spec_2 (spec);
do_spec_1 (" ", 0, NULL);
@ -4384,10 +4325,7 @@ do_self_spec (spec)
and the command on that line reported an error. */
static int
do_spec_1 (spec, inswitch, soft_matched_part)
const char *spec;
int inswitch;
const char *soft_matched_part;
do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
const char *p = spec;
int c;
@ -4681,7 +4619,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
p++;
if (p[0] == '%' && p[1] == 'O')
p += 2;
break;
}
goto create_temp_file;
@ -4693,7 +4631,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
p++;
if (p[0] == '%' && p[1] == 'O')
p += 2;
break;
}
goto create_temp_file;
@ -4744,24 +4682,24 @@ do_spec_1 (spec, inswitch, soft_matched_part)
temp_filename = alloca (temp_filename_length + 1);
strncpy ((char *) temp_filename, input_basename, basename_length);
strncpy ((char *) temp_filename + basename_length, suffix,
suffix_length);
suffix_length);
*((char *) temp_filename + temp_filename_length) = '\0';
if (strcmp (temp_filename, input_filename) != 0)
{
struct stat st_temp;
struct stat st_temp;
/* Note, set_input() resets input_stat_set to 0. */
if (input_stat_set == 0)
{
input_stat_set = stat (input_filename, &input_stat);
if (input_stat_set >= 0)
input_stat_set = 1;
}
/* Note, set_input() resets input_stat_set to 0. */
if (input_stat_set == 0)
{
input_stat_set = stat (input_filename, &input_stat);
if (input_stat_set >= 0)
input_stat_set = 1;
}
/* If we have the stat for the input_filename
and we can do the stat for the temp_filename
then the they could still refer to the same
file if st_dev/st_ino's are the same. */
/* If we have the stat for the input_filename
and we can do the stat for the temp_filename
then the they could still refer to the same
file if st_dev/st_ino's are the same. */
if (input_stat_set != 1
|| stat (temp_filename, &st_temp) < 0
@ -4771,7 +4709,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
temp_filename = save_string (temp_filename,
temp_filename_length + 1);
obstack_grow (&obstack, temp_filename,
temp_filename_length);
temp_filename_length);
arg_going = 1;
delete_this_arg = 0;
break;
@ -5058,11 +4996,11 @@ do_spec_1 (spec, inswitch, soft_matched_part)
/* We assume there is a directory
separator at the end of this string. */
if (target_system_root)
{
obstack_grow (&obstack, target_system_root,
{
obstack_grow (&obstack, target_system_root,
strlen (target_system_root));
if (target_sysroot_suffix)
obstack_grow (&obstack, target_sysroot_suffix,
obstack_grow (&obstack, target_sysroot_suffix,
strlen (target_sysroot_suffix));
}
break;
@ -5264,8 +5202,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
/* Look up a spec function. */
static const struct spec_function *
lookup_spec_function (name)
const char *name;
lookup_spec_function (const char *name)
{
static const struct spec_function * const spec_function_tables[] =
{
@ -5288,8 +5225,7 @@ lookup_spec_function (name)
/* Evaluate a spec function. */
static const char *
eval_spec_function (func, args)
const char *func, *args;
eval_spec_function (const char *func, const char *args)
{
const struct spec_function *sf;
const char *funcval;
@ -5361,8 +5297,7 @@ eval_spec_function (func, args)
NULL if no processing is required. */
static const char *
handle_spec_function (p)
const char *p;
handle_spec_function (const char *p)
{
char *func, *args;
const char *endp, *funcval;
@ -5420,9 +5355,7 @@ handle_spec_function (p)
/* Inline subroutine of handle_braces. Returns true if the current
input suffix matches the atom bracketed by ATOM and END_ATOM. */
static inline bool
input_suffix_matches (atom, end_atom)
const char *atom;
const char *end_atom;
input_suffix_matches (const char *atom, const char *end_atom)
{
return (input_suffix
&& !strncmp (input_suffix, atom, end_atom - atom)
@ -5433,10 +5366,7 @@ input_suffix_matches (atom, end_atom)
matching the atom bracketed by ATOM and END_ATOM appeared on the
command line. */
static inline bool
switch_matches (atom, end_atom, starred)
const char *atom;
const char *end_atom;
int starred;
switch_matches (const char *atom, const char *end_atom, int starred)
{
int i;
int len = end_atom - atom;
@ -5455,10 +5385,7 @@ switch_matches (atom, end_atom, starred)
match ATOM (extends to END_ATOM; STARRED indicates whether there
was a star after the atom) for later processing. */
static inline void
mark_matching_switches (atom, end_atom, starred)
const char *atom;
const char *end_atom;
int starred;
mark_matching_switches (const char *atom, const char *end_atom, int starred)
{
int i;
int len = end_atom - atom;
@ -5474,7 +5401,7 @@ mark_matching_switches (atom, end_atom, starred)
/* Inline subroutine of handle_braces. Process all the currently
marked switches through give_switch, and clear the marks. */
static inline void
process_marked_switches ()
process_marked_switches (void)
{
int i;
@ -5491,8 +5418,7 @@ process_marked_switches ()
if we call do_spec_1 and that returns -1. */
static const char *
handle_braces (p)
const char *p;
handle_braces (const char *p)
{
const char *atom, *end_atom;
const char *d_atom = NULL, *d_end_atom = NULL;
@ -5640,12 +5566,8 @@ handle_braces (p)
returns -1. */
static const char *
process_brace_body (p, atom, end_atom, starred, matched)
const char *p;
const char *atom;
const char *end_atom;
int starred;
int matched;
process_brace_body (const char *p, const char *atom, const char *end_atom,
int starred, int matched)
{
const char *body, *end_body;
unsigned int nesting_level;
@ -5672,7 +5594,7 @@ process_brace_body (p, atom, end_atom, starred, matched)
abort ();
p++;
}
end_body = p;
while (end_body[-1] == ' ' || end_body[-1] == '\t')
end_body--;
@ -5725,9 +5647,7 @@ process_brace_body (p, atom, end_atom, starred, matched)
with the "no-", similarly for a switch with the "no-" prefix. */
static int
check_live_switch (switchnum, prefix_length)
int switchnum;
int prefix_length;
check_live_switch (int switchnum, int prefix_length)
{
const char *name = switches[switchnum].part1;
int i;
@ -5801,9 +5721,7 @@ check_live_switch (switchnum, prefix_length)
If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument. */
static void
give_switch (switchnum, omit_first_word)
int switchnum;
int omit_first_word;
give_switch (int switchnum, int omit_first_word)
{
if (switches[switchnum].live_cond == SWITCH_IGNORE)
return;
@ -5853,8 +5771,7 @@ give_switch (switchnum, omit_first_word)
Return the absolute file name found. If nothing is found, return NAME. */
static const char *
find_file (name)
const char *name;
find_file (const char *name)
{
char *newname;
@ -5879,10 +5796,7 @@ find_file (name)
limit. */
static int
is_directory (path1, path2, linker)
const char *path1;
const char *path2;
int linker;
is_directory (const char *path1, const char *path2, int linker)
{
int len1 = strlen (path1);
int len2 = strlen (path2);
@ -5924,8 +5838,7 @@ is_directory (path1, path2, linker)
the input file named FILENAME. */
void
set_input (filename)
const char *filename;
set_input (const char *filename)
{
const char *p;
@ -5966,8 +5879,7 @@ set_input (filename)
/* On fatal signals, delete all the temporary files. */
static void
fatal_error (signum)
int signum;
fatal_error (int signum)
{
signal (signum, SIG_DFL);
delete_failure_queue ();
@ -5977,12 +5889,10 @@ fatal_error (signum)
kill (getpid (), signum);
}
extern int main PARAMS ((int, const char *const *));
extern int main (int, const char *const *);
int
main (argc, argv)
int argc;
const char *const *argv;
main (int argc, const char *const *argv)
{
size_t i;
int value;
@ -6512,10 +6422,7 @@ main (argc, argv)
or 0 if this file is to be passed to the linker. */
static struct compiler *
lookup_compiler (name, length, language)
const char *name;
size_t length;
const char *language;
lookup_compiler (const char *name, size_t length, const char *language)
{
struct compiler *cp;
@ -6581,9 +6488,7 @@ lookup_compiler (name, length, language)
}
static char *
save_string (s, len)
const char *s;
int len;
save_string (const char *s, int len)
{
char *result = xmalloc (len + 1);
@ -6593,8 +6498,7 @@ save_string (s, len)
}
void
pfatal_with_name (name)
const char *name;
pfatal_with_name (const char *name)
{
perror_with_name (name);
delete_temp_files ();
@ -6602,16 +6506,13 @@ pfatal_with_name (name)
}
static void
perror_with_name (name)
const char *name;
perror_with_name (const char *name)
{
error ("%s: %s", name, xstrerror (errno));
}
static void
pfatal_pexecute (errmsg_fmt, errmsg_arg)
const char *errmsg_fmt;
const char *errmsg_arg;
pfatal_pexecute (const char *errmsg_fmt, const char *errmsg_arg)
{
if (errmsg_arg)
{
@ -6631,7 +6532,7 @@ pfatal_pexecute (errmsg_fmt, errmsg_arg)
/* Output an error message and exit. */
void
fancy_abort ()
fancy_abort (void)
{
fatal ("internal gcc abort");
}
@ -6642,7 +6543,7 @@ void
fatal (const char *msgid, ...)
{
va_list ap;
va_start (ap, msgid);
fprintf (stderr, "%s: ", programname);
@ -6657,7 +6558,7 @@ void
error (const char *msgid, ...)
{
va_list ap;
va_start (ap, msgid);
fprintf (stderr, "%s: ", programname);
vfprintf (stderr, _(msgid), ap);
@ -6670,15 +6571,14 @@ static void
notice (const char *msgid, ...)
{
va_list ap;
va_start (ap, msgid);
vfprintf (stderr, _(msgid), ap);
va_end (ap);
}
static inline void
validate_switches_from_spec (spec)
const char *spec;
validate_switches_from_spec (const char *spec)
{
const char *p = spec;
char c;
@ -6689,7 +6589,7 @@ validate_switches_from_spec (spec)
}
static void
validate_all_switches ()
validate_all_switches (void)
{
struct compiler *comp;
struct spec_list *spec;
@ -6708,8 +6608,7 @@ validate_all_switches ()
and mark as valid all supplied switches that match it. */
static const char *
validate_switches (start)
const char *start;
validate_switches (const char *start)
{
const char *p = start;
const char *atom;
@ -6717,9 +6616,9 @@ validate_switches (start)
int i;
bool suffix = false;
bool starred = false;
#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
next_member:
SKIP_WHITE ();
@ -6792,9 +6691,7 @@ static int n_mdswitches;
canonicalize the switches to keep only the ones we care about. */
static int
used_arg (p, len)
const char *p;
int len;
used_arg (const char *p, int len)
{
struct mswitchstr
{
@ -6932,9 +6829,7 @@ used_arg (p, len)
}
static int
default_arg (p, len)
const char *p;
int len;
default_arg (const char *p, int len)
{
int i;
@ -6957,7 +6852,7 @@ default_arg (p, len)
will be used. */
static void
set_multilib_dir ()
set_multilib_dir (void)
{
const char *p;
unsigned int this_path_len;
@ -6993,7 +6888,7 @@ set_multilib_dir ()
if (*start == '\0')
break;
for (end = start + 1;
*end != ' ' && *end != '\t' && *end != '\0'; end++)
;
@ -7192,7 +7087,7 @@ set_multilib_dir ()
the exclusions. */
static void
print_multilib_info ()
print_multilib_info (void)
{
const char *p = multilib_select;
const char *last_path = 0, *this_path;
@ -7440,9 +7335,7 @@ print_multilib_info ()
(whose name has been expanded with %s). */
static const char *
if_exists_spec_function (argc, argv)
int argc;
const char **argv;
if_exists_spec_function (int argc, const char **argv)
{
/* Must have only one argument. */
if (argc == 1 && IS_ABSOLUTE_PATH (argv[0]) && ! access (argv[0], R_OK))
@ -7457,9 +7350,7 @@ if_exists_spec_function (argc, argv)
is returned if the first argument does not exist. */
static const char *
if_exists_else_spec_function (argc, argv)
int argc;
const char **argv;
if_exists_else_spec_function (int argc, const char **argv)
{
/* Must have exactly two arguments. */
if (argc != 2)

View File

@ -26,9 +26,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* The mapping of a spec function name to the C function that
implements it. */
struct spec_function
{
{
const char *name;
const char *(*func) PARAMS ((int, const char **));
const char *(*func) (int, const char **);
};
/* This defines which switch letters take arguments. */
@ -54,22 +54,21 @@ struct spec_function
/* These are exported by gcc.c. */
extern int do_spec PARAMS ((const char *));
extern void record_temp_file PARAMS ((const char *, int, int));
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
extern void fatal PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
extern void pfatal_with_name PARAMS ((const char *)) ATTRIBUTE_NORETURN;
extern void set_input PARAMS ((const char *));
extern int do_spec (const char *);
extern void record_temp_file (const char *, int, int);
extern void fancy_abort (void) ATTRIBUTE_NORETURN;
extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void pfatal_with_name (const char *) ATTRIBUTE_NORETURN;
extern void set_input (const char *);
/* Spec files linked with gcc.c must provide definitions for these. */
/* Called before processing to change/add/remove arguments. */
extern void lang_specific_driver PARAMS ((int *, const char *const **, int *));
extern void lang_specific_driver (int *, const char *const **, int *);
/* Called before linking. Returns 0 on success and -1 on failure. */
extern int lang_specific_pre_link PARAMS ((void));
extern int lang_specific_pre_link (void);
extern int n_infiles;

View File

@ -1,5 +1,5 @@
/* Dump a gcov file, for debugging use.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Nathan Sidwell <nathan@codesourcery.com>
Gcov is free software; you can redistribute it and/or modify
@ -27,17 +27,17 @@ Boston, MA 02111-1307, USA. */
#include "gcov-io.h"
#include "gcov-io.c"
static void dump_file PARAMS ((const char *));
static void print_prefix PARAMS ((const char *, unsigned, gcov_position_t));
static void print_usage PARAMS ((void));
static void print_version PARAMS ((void));
static void tag_function PARAMS ((const char *, unsigned, unsigned));
static void tag_blocks PARAMS ((const char *, unsigned, unsigned));
static void tag_arcs PARAMS ((const char *, unsigned, unsigned));
static void tag_lines PARAMS ((const char *, unsigned, unsigned));
static void tag_counters PARAMS ((const char *, unsigned, unsigned));
static void tag_summary PARAMS ((const char *, unsigned, unsigned));
extern int main PARAMS ((int, char **));
static void dump_file (const char *);
static void print_prefix (const char *, unsigned, gcov_position_t);
static void print_usage (void);
static void print_version (void);
static void tag_function (const char *, unsigned, unsigned);
static void tag_blocks (const char *, unsigned, unsigned);
static void tag_arcs (const char *, unsigned, unsigned);
static void tag_lines (const char *, unsigned, unsigned);
static void tag_counters (const char *, unsigned, unsigned);
static void tag_summary (const char *, unsigned, unsigned);
extern int main (int, char **);
typedef struct tag_format
{
@ -72,9 +72,8 @@ static const tag_format_t tag_table[] =
{0, NULL, NULL}
};
int main (argc, argv)
int argc ATTRIBUTE_UNUSED;
char **argv;
int
main (int argc ATTRIBUTE_UNUSED, char **argv)
{
int opt;
@ -98,14 +97,14 @@ int main (argc, argv)
fprintf (stderr, "unknown flag `%c'\n", opt);
}
}
while (argv[optind])
dump_file (argv[optind++]);
return 0;
}
static void
print_usage ()
print_usage (void)
{
printf ("Usage: gcov-dump [OPTION] ... gcovfiles\n");
printf ("Print coverage file contents\n");
@ -116,7 +115,7 @@ print_usage ()
}
static void
print_version ()
print_version (void)
{
char v[4];
unsigned version = GCOV_VERSION;
@ -131,13 +130,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
}
static void
print_prefix (filename, depth, position)
const char *filename;
unsigned depth;
gcov_position_t position;
print_prefix (const char *filename, unsigned depth, gcov_position_t position)
{
static const char prefix[] = " ";
printf ("%s:", filename);
if (flag_dump_positions)
printf ("%lu:", (unsigned long) position);
@ -145,18 +141,17 @@ print_prefix (filename, depth, position)
}
static void
dump_file (filename)
const char *filename;
dump_file (const char *filename)
{
unsigned tags[4];
unsigned depth = 0;
if (!gcov_open (filename, 1))
{
fprintf (stderr, "%s:cannot open\n", filename);
return;
}
/* magic */
{
unsigned magic = gcov_read_unsigned ();
@ -166,7 +161,7 @@ dump_file (filename)
unsigned expected = GCOV_VERSION;
unsigned ix;
int different = version != GCOV_VERSION;
if (magic == GCOV_DATA_MAGIC)
type = "data";
else if (magic == GCOV_GRAPH_MAGIC)
@ -183,7 +178,7 @@ dump_file (filename)
v[ix] = version;
m[ix] = magic;
}
printf ("%s:%s:magic `%.4s':version `%.4s'\n", filename, type, m, v);
if (different)
printf ("%s:warning:current version is `%.4s'\n", filename, e);
@ -229,17 +224,17 @@ dump_file (filename)
depth = tag_depth;
tags[depth - 1] = tag;
}
print_prefix (filename, tag_depth, position);
printf ("%08x:%4u:%s", tag, length, format->name);
if (format->proc)
(*format->proc) (filename, tag, length);
printf ("\n");
if (flag_dump_contents && format->proc)
{
unsigned long actual_length = gcov_position () - base;
if (actual_length > length)
printf ("%s:record size mismatch %lu bytes overread\n",
filename, actual_length - length);
@ -262,20 +257,18 @@ dump_file (filename)
}
static void
tag_function (filename, tag, length)
const char *filename ATTRIBUTE_UNUSED;
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
tag_function (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
unsigned long pos = gcov_position ();
printf (" ident=%u", gcov_read_unsigned ());
printf (", checksum=0x%08x", gcov_read_unsigned ());
if (gcov_position () - pos < length)
{
const char *name;
name = gcov_read_string ();
printf (", `%s'", name ? name : "NULL");
name = gcov_read_string ();
@ -285,13 +278,11 @@ tag_function (filename, tag, length)
}
static void
tag_blocks (filename, tag, length)
const char *filename ATTRIBUTE_UNUSED;
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
tag_blocks (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
unsigned n_blocks = length / 4;
printf (" %u blocks", n_blocks);
if (flag_dump_contents)
@ -312,10 +303,8 @@ tag_blocks (filename, tag, length)
}
static void
tag_arcs (filename, tag, length)
const char *filename ATTRIBUTE_UNUSED;
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
tag_arcs (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
unsigned n_arcs = (length - 4) / 8;
@ -328,7 +317,7 @@ tag_arcs (filename, tag, length)
for (ix = 0; ix != n_arcs; ix++)
{
unsigned dst, flags;
if (!(ix & 3))
{
printf ("\n");
@ -343,10 +332,8 @@ tag_arcs (filename, tag, length)
}
static void
tag_lines (filename, tag, length)
const char *filename ATTRIBUTE_UNUSED;
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
tag_lines (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
if (flag_dump_contents)
{
@ -358,7 +345,7 @@ tag_lines (filename, tag, length)
gcov_position_t position = gcov_position ();
const char *source = NULL;
unsigned lineno = gcov_read_unsigned ();
if (!lineno)
{
source = gcov_read_string ();
@ -366,7 +353,7 @@ tag_lines (filename, tag, length)
break;
sep = NULL;
}
if (!sep)
{
printf ("\n");
@ -389,14 +376,12 @@ tag_lines (filename, tag, length)
}
static void
tag_counters (filename, tag, length)
const char *filename ATTRIBUTE_UNUSED;
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
tag_counters (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
static const char *const counter_names[] = GCOV_COUNTER_NAMES;
unsigned n_counts = length / 8;
printf (" %s %u counts",
counter_names[GCOV_COUNTER_FOR_TAG (tag)], n_counts);
if (flag_dump_contents)
@ -406,14 +391,14 @@ tag_counters (filename, tag, length)
for (ix = 0; ix != n_counts; ix++)
{
gcov_type count;
if (!(ix & 7))
{
printf ("\n");
print_prefix (filename, 0, gcov_position ());
printf ("\t\t%u", ix);
}
count = gcov_read_counter ();
printf (" ");
printf (HOST_WIDEST_INT_PRINT_DEC, count);
@ -422,24 +407,22 @@ tag_counters (filename, tag, length)
}
static void
tag_summary (filename, tag, length)
const char *filename ATTRIBUTE_UNUSED;
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
tag_summary (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
struct gcov_summary summary;
unsigned ix;
gcov_read_summary (&summary);
printf (" checksum=0x%08x", summary.checksum);
for (ix = 0; ix != GCOV_COUNTERS; ix++)
{
printf ("\n");
print_prefix (filename, 0, 0);
printf ("\t\tcounts=%u, runs=%u",
summary.ctrs[ix].num, summary.ctrs[ix].runs);
printf (", sum_all=" HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT)summary.ctrs[ix].sum_all);
printf (", run_max=" HOST_WIDEST_INT_PRINT_DEC,

View File

@ -1,8 +1,8 @@
/* Generate gcov version string from version.c. See gcov-io.h for
description of how the version string is generated.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Nathan Sidwell <nathan@codesourcery.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
@ -26,12 +26,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h"
#include "version.c" /* We want the actual string. */
int main PARAMS ((int, char **));
int main (int, char **);
int
main (argc, argv)
int argc ATTRIBUTE_UNUSED;
char **argv;
main (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
unsigned version = 0;
unsigned char v[4];
@ -56,7 +54,7 @@ main (argc, argv)
v[1] = (minor / 10) + '0';
v[2] = (minor % 10) + '0';
v[3] = s ? s : '*';
for (ix = 0; ix != 4; ix++)
version = (version << 8) | v[ix];
@ -65,6 +63,6 @@ main (argc, argv)
printf ("\n");
printf ("#define GCOV_VERSION ((unsigned)%#08x) /* %.4s */\n",
version, v);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -219,8 +219,7 @@ extern void ggc_splay_dont_free (void *, void *);
/* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS.
If LENGTH is -1, then CONTENTS is assumed to be a
null-terminated string and the memory sized accordingly. */
extern const char *ggc_alloc_string PARAMS ((const char *contents,
int length));
extern const char *ggc_alloc_string (const char *contents, int length);
/* Make a copy of S, in GC-able memory. */
#define ggc_strdup(S) ggc_alloc_string((S), -1)

View File

@ -1,6 +1,6 @@
/* Allocate registers for pseudo-registers that span basic blocks.
Copyright (C) 1987, 1988, 1991, 1994, 1996, 1997, 1998,
1999, 2000, 2002 Free Software Foundation, Inc.
1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -289,24 +289,23 @@ static int n_regs_set;
static HARD_REG_SET eliminable_regset;
static int allocno_compare PARAMS ((const void *, const void *));
static void global_conflicts PARAMS ((void));
static void mirror_conflicts PARAMS ((void));
static void expand_preferences PARAMS ((void));
static void prune_preferences PARAMS ((void));
static void find_reg PARAMS ((int, HARD_REG_SET, int, int, int));
static void record_one_conflict PARAMS ((int));
static void record_conflicts PARAMS ((int *, int));
static void mark_reg_store PARAMS ((rtx, rtx, void *));
static void mark_reg_clobber PARAMS ((rtx, rtx, void *));
static void mark_reg_conflicts PARAMS ((rtx));
static void mark_reg_death PARAMS ((rtx));
static void mark_reg_live_nc PARAMS ((int, enum machine_mode));
static void set_preference PARAMS ((rtx, rtx));
static void dump_conflicts PARAMS ((FILE *));
static void reg_becomes_live PARAMS ((rtx, rtx, void *));
static void reg_dies PARAMS ((int, enum machine_mode,
struct insn_chain *));
static int allocno_compare (const void *, const void *);
static void global_conflicts (void);
static void mirror_conflicts (void);
static void expand_preferences (void);
static void prune_preferences (void);
static void find_reg (int, HARD_REG_SET, int, int, int);
static void record_one_conflict (int);
static void record_conflicts (int *, int);
static void mark_reg_store (rtx, rtx, void *);
static void mark_reg_clobber (rtx, rtx, void *);
static void mark_reg_conflicts (rtx);
static void mark_reg_death (rtx);
static void mark_reg_live_nc (int, enum machine_mode);
static void set_preference (rtx, rtx);
static void dump_conflicts (FILE *);
static void reg_becomes_live (rtx, rtx, void *);
static void reg_dies (int, enum machine_mode, struct insn_chain *);
/* Perform allocation of pseudo-registers not allocated by local_alloc.
FILE is a file to output debugging information on,
@ -316,8 +315,7 @@ static void reg_dies PARAMS ((int, enum machine_mode,
and we must not do any more for this function. */
int
global_alloc (file)
FILE *file;
global_alloc (FILE *file)
{
int retval;
#ifdef ELIMINABLE_REGS
@ -599,9 +597,7 @@ global_alloc (file)
Returns -1 (1) if *v1 should be allocated before (after) *v2. */
static int
allocno_compare (v1p, v2p)
const void *v1p;
const void *v2p;
allocno_compare (const void *v1p, const void *v2p)
{
int v1 = *(const int *)v1p, v2 = *(const int *)v2p;
/* Note that the quotient will never be bigger than
@ -629,7 +625,7 @@ allocno_compare (v1p, v2p)
conflict matrices and preference tables. */
static void
global_conflicts ()
global_conflicts (void)
{
int i;
basic_block b;
@ -703,11 +699,11 @@ global_conflicts ()
scan the instruction that makes either X or Y become live. */
record_conflicts (block_start_allocnos, ax);
/* Pseudos can't go in stack regs at the start of a basic block that
is reached by an abnormal edge. Likewise for call clobbered regs,
because because caller-save, fixup_abnormal_edges, and possibly
the table driven EH machinery are not quite ready to handle such
regs live across such edges. */
/* Pseudos can't go in stack regs at the start of a basic block that
is reached by an abnormal edge. Likewise for call clobbered regs,
because because caller-save, fixup_abnormal_edges, and possibly
the table driven EH machinery are not quite ready to handle such
regs live across such edges. */
{
edge e;
@ -852,7 +848,7 @@ global_conflicts ()
merge any preferences between those allocnos. */
static void
expand_preferences ()
expand_preferences (void)
{
rtx insn;
rtx link;
@ -903,7 +899,7 @@ expand_preferences ()
we will avoid using these registers. */
static void
prune_preferences ()
prune_preferences (void)
{
int i;
int num;
@ -991,12 +987,7 @@ prune_preferences ()
If not, do nothing. */
static void
find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
int num;
HARD_REG_SET losers;
int alt_regs_p;
int accept_call_clobbered;
int retrying;
find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbered, int retrying)
{
int i, best_reg, pass;
HARD_REG_SET used, used1, used2;
@ -1110,7 +1101,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
(j < lim
&& ! TEST_HARD_REG_BIT (used, j)
&& (REGNO_REG_CLASS (j)
== REGNO_REG_CLASS (best_reg + (j - i))
== REGNO_REG_CLASS (best_reg + (j - i))
|| reg_class_subset_p (REGNO_REG_CLASS (j),
REGNO_REG_CLASS (best_reg + (j - i)))
|| reg_class_subset_p (REGNO_REG_CLASS (best_reg + (j - i)),
@ -1149,7 +1140,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
(j < lim
&& ! TEST_HARD_REG_BIT (used, j)
&& (REGNO_REG_CLASS (j)
== REGNO_REG_CLASS (best_reg + (j - i))
== REGNO_REG_CLASS (best_reg + (j - i))
|| reg_class_subset_p (REGNO_REG_CLASS (j),
REGNO_REG_CLASS (best_reg + (j - i)))
|| reg_class_subset_p (REGNO_REG_CLASS (best_reg + (j - i)),
@ -1311,9 +1302,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
If FORBIDDEN_REGS is zero, no regs are forbidden. */
void
retry_global_alloc (regno, forbidden_regs)
int regno;
HARD_REG_SET forbidden_regs;
retry_global_alloc (int regno, HARD_REG_SET forbidden_regs)
{
int alloc_no = reg_allocno[regno];
if (alloc_no >= 0)
@ -1344,8 +1333,7 @@ retry_global_alloc (regno, forbidden_regs)
reg_renumber before calling here. */
static void
record_one_conflict (regno)
int regno;
record_one_conflict (int regno)
{
int j;
@ -1388,9 +1376,7 @@ record_one_conflict (regno)
are currently live. Their bits are also flagged in allocnos_live. */
static void
record_conflicts (allocno_vec, len)
int *allocno_vec;
int len;
record_conflicts (int *allocno_vec, int len)
{
while (--len >= 0)
IOR_HARD_REG_SET (allocno[allocno_vec[len]].hard_reg_conflicts,
@ -1399,7 +1385,7 @@ record_conflicts (allocno_vec, len)
/* If CONFLICTP (i, j) is true, make sure CONFLICTP (j, i) is also true. */
static void
mirror_conflicts ()
mirror_conflicts (void)
{
int i, j;
int rw = allocno_row_words;
@ -1447,9 +1433,7 @@ mirror_conflicts ()
a REG_INC note was found for it). */
static void
mark_reg_store (reg, setter, data)
rtx reg, setter;
void *data ATTRIBUTE_UNUSED;
mark_reg_store (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED)
{
int regno;
@ -1496,9 +1480,7 @@ mark_reg_store (reg, setter, data)
/* Like mark_reg_set except notice just CLOBBERs; ignore SETs. */
static void
mark_reg_clobber (reg, setter, data)
rtx reg, setter;
void *data ATTRIBUTE_UNUSED;
mark_reg_clobber (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED)
{
if (GET_CODE (setter) == CLOBBER)
mark_reg_store (reg, setter, data);
@ -1508,8 +1490,7 @@ mark_reg_clobber (reg, setter, data)
Do not mark REG itself as live. */
static void
mark_reg_conflicts (reg)
rtx reg;
mark_reg_conflicts (rtx reg)
{
int regno;
@ -1548,8 +1529,7 @@ mark_reg_conflicts (reg)
Store a 0 in regs_live or allocnos_live for this register. */
static void
mark_reg_death (reg)
rtx reg;
mark_reg_death (rtx reg)
{
int regno = REGNO (reg);
@ -1585,9 +1565,7 @@ mark_reg_death (reg)
it is assumed that the caller will do that. */
static void
mark_reg_live_nc (regno, mode)
int regno;
enum machine_mode mode;
mark_reg_live_nc (int regno, enum machine_mode mode)
{
int last = regno + HARD_REGNO_NREGS (regno, mode);
while (regno < last)
@ -1607,8 +1585,7 @@ mark_reg_live_nc (regno, mode)
pseudo-register to a hard register. */
static void
set_preference (dest, src)
rtx dest, src;
set_preference (rtx dest, rtx src)
{
unsigned int src_regno, dest_regno;
/* Amount to add to the hard regno for SRC, or subtract from that for DEST,
@ -1715,8 +1692,7 @@ set_preference (dest, src)
a use of TO. */
void
mark_elimination (from, to)
int from, to;
mark_elimination (int from, int to)
{
basic_block bb;
@ -1738,10 +1714,7 @@ static regset live_relevant_regs;
/* Record in live_relevant_regs and REGS_SET that register REG became live.
This is called via note_stores. */
static void
reg_becomes_live (reg, setter, regs_set)
rtx reg;
rtx setter ATTRIBUTE_UNUSED;
void *regs_set;
reg_becomes_live (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *regs_set)
{
int regno;
@ -1772,10 +1745,7 @@ reg_becomes_live (reg, setter, regs_set)
/* Record in live_relevant_regs that register REGNO died. */
static void
reg_dies (regno, mode, chain)
int regno;
enum machine_mode mode;
struct insn_chain *chain;
reg_dies (int regno, enum machine_mode mode, struct insn_chain *chain)
{
if (regno < FIRST_PSEUDO_REGISTER)
{
@ -1799,8 +1769,7 @@ reg_dies (regno, mode, chain)
/* Walk the insns of the current function and build reload_insn_chain,
and record register life information. */
void
build_insn_chain (first)
rtx first;
build_insn_chain (rtx first)
{
struct insn_chain **p = &reload_insn_chain;
struct insn_chain *prev = 0;
@ -1905,8 +1874,7 @@ build_insn_chain (first)
showing the information on which the allocation decisions are based. */
static void
dump_conflicts (file)
FILE *file;
dump_conflicts (FILE *file)
{
int i;
int has_preferences;
@ -1963,8 +1931,7 @@ dump_conflicts (file)
}
void
dump_global_regs (file)
FILE *file;
dump_global_regs (FILE *file)
{
int i, j;

View File

@ -1,5 +1,5 @@
/* Output routines for graphical representation.
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
This file is part of GCC.
@ -39,17 +39,16 @@ static const char *const graph_ext[] =
/* vcg */ ".vcg",
};
static void start_fct PARAMS ((FILE *));
static void start_bb PARAMS ((FILE *, int));
static void node_data PARAMS ((FILE *, rtx));
static void draw_edge PARAMS ((FILE *, int, int, int, int));
static void end_fct PARAMS ((FILE *));
static void end_bb PARAMS ((FILE *));
static void start_fct (FILE *);
static void start_bb (FILE *, int);
static void node_data (FILE *, rtx);
static void draw_edge (FILE *, int, int, int, int);
static void end_fct (FILE *);
static void end_bb (FILE *);
/* Output text for new basic block. */
static void
start_fct (fp)
FILE *fp;
start_fct (FILE *fp)
{
switch (graph_dump_format)
{
@ -64,9 +63,7 @@ graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n",
}
static void
start_bb (fp, bb)
FILE *fp;
int bb;
start_bb (FILE *fp, int bb)
{
switch (graph_dump_format)
{
@ -105,9 +102,7 @@ label: \"basic block %d",
}
static void
node_data (fp, tmp_rtx)
FILE *fp;
rtx tmp_rtx;
node_data (FILE *fp, rtx tmp_rtx)
{
if (PREV_INSN (tmp_rtx) == 0)
{
@ -168,12 +163,7 @@ darkgrey\n shape: ellipse" : "white",
}
static void
draw_edge (fp, from, to, bb_edge, class)
FILE *fp;
int from;
int to;
int bb_edge;
int class;
draw_edge (FILE *fp, int from, int to, int bb_edge, int class)
{
const char * color;
switch (graph_dump_format)
@ -200,8 +190,7 @@ draw_edge (fp, from, to, bb_edge, class)
}
static void
end_bb (fp)
FILE *fp;
end_bb (FILE *fp)
{
switch (graph_dump_format)
{
@ -214,8 +203,7 @@ end_bb (fp)
}
static void
end_fct (fp)
FILE *fp;
end_fct (FILE *fp)
{
switch (graph_dump_format)
{
@ -231,10 +219,7 @@ end_fct (fp)
/* Like print_rtl, but also print out live information for the start of each
basic block. */
void
print_rtl_graph_with_bb (base, suffix, rtx_first)
const char *base;
const char *suffix;
rtx rtx_first;
print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
{
rtx tmp_rtx;
size_t namelen = strlen (base);
@ -400,9 +385,7 @@ print_rtl_graph_with_bb (base, suffix, rtx_first)
/* Similar as clean_dump_file, but this time for graph output files. */
void
clean_graph_dump_file (base, suffix)
const char *base;
const char *suffix;
clean_graph_dump_file (const char *base, const char *suffix)
{
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
@ -434,9 +417,7 @@ clean_graph_dump_file (base, suffix)
/* Do final work on the graph output file. */
void
finish_graph_dump_file (base, suffix)
const char *base;
const char *suffix;
finish_graph_dump_file (const char *base, const char *suffix)
{
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);

View File

@ -1,5 +1,5 @@
/* Header file for graph routines.
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -21,8 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_GRAPH_H
#define GCC_GRAPH_H
extern void print_rtl_graph_with_bb PARAMS ((const char *, const char *, rtx));
extern void clean_graph_dump_file PARAMS ((const char *, const char *));
extern void finish_graph_dump_file PARAMS ((const char *, const char *));
extern void print_rtl_graph_with_bb (const char *, const char *, rtx);
extern void clean_graph_dump_file (const char *, const char *);
extern void finish_graph_dump_file (const char *, const char *);
#endif /* ! GCC_GRAPH_H */

View File

@ -1,6 +1,6 @@
/* Instruction scheduling pass.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com)
@ -189,8 +189,7 @@ static int old_max_uid;
of the -fsched-verbose=N option. */
void
fix_sched_param (param, val)
const char *param, *val;
fix_sched_param (const char *param, const char *val)
{
if (!strcmp (param, "verbose"))
sched_verbose_param = atoi (val);
@ -305,7 +304,7 @@ struct ready_list
int n_ready;
};
static int may_trap_exp PARAMS ((rtx, int));
static int may_trap_exp (rtx, int);
/* Nonzero iff the address is comprised from at most 1 register. */
#define CONST_BASED_ADDRESS_P(x) \
@ -319,9 +318,7 @@ static int may_trap_exp PARAMS ((rtx, int));
as found by analyzing insn's expression. */
static int
may_trap_exp (x, is_store)
rtx x;
int is_store;
may_trap_exp (rtx x, int is_store)
{
enum rtx_code code;
@ -394,8 +391,7 @@ may_trap_exp (x, is_store)
being either PFREE or PRISKY. */
int
haifa_classify_insn (insn)
rtx insn;
haifa_classify_insn (rtx insn)
{
rtx pat = PATTERN (insn);
int tmp_class = TRAP_FREE;
@ -473,21 +469,21 @@ haifa_classify_insn (insn)
/* The scheduler using only DFA description should never use the
following five functions: */
static unsigned int blockage_range PARAMS ((int, rtx));
static void clear_units PARAMS ((void));
static void schedule_unit PARAMS ((int, rtx, int));
static int actual_hazard PARAMS ((int, rtx, int, int));
static int potential_hazard PARAMS ((int, rtx, int));
static unsigned int blockage_range (int, rtx);
static void clear_units (void);
static void schedule_unit (int, rtx, int);
static int actual_hazard (int, rtx, int, int);
static int potential_hazard (int, rtx, int);
static int priority PARAMS ((rtx));
static int rank_for_schedule PARAMS ((const void *, const void *));
static void swap_sort PARAMS ((rtx *, int));
static void queue_insn PARAMS ((rtx, int));
static int schedule_insn PARAMS ((rtx, struct ready_list *, int));
static int find_set_reg_weight PARAMS ((rtx));
static void find_insn_reg_weight PARAMS ((int));
static void adjust_priority PARAMS ((rtx));
static void advance_one_cycle PARAMS ((void));
static int priority (rtx);
static int rank_for_schedule (const void *, const void *);
static void swap_sort (rtx *, int);
static void queue_insn (rtx, int);
static int schedule_insn (rtx, struct ready_list *, int);
static int find_set_reg_weight (rtx);
static void find_insn_reg_weight (int);
static void adjust_priority (rtx);
static void advance_one_cycle (void);
/* Notes handling mechanism:
=========================
@ -512,28 +508,28 @@ static void advance_one_cycle PARAMS ((void));
unlink_other_notes ()). After scheduling the block, these notes are
inserted at the beginning of the block (in schedule_block()). */
static rtx unlink_other_notes PARAMS ((rtx, rtx));
static rtx unlink_line_notes PARAMS ((rtx, rtx));
static rtx reemit_notes PARAMS ((rtx, rtx));
static rtx unlink_other_notes (rtx, rtx);
static rtx unlink_line_notes (rtx, rtx);
static rtx reemit_notes (rtx, rtx);
static rtx *ready_lastpos PARAMS ((struct ready_list *));
static void ready_sort PARAMS ((struct ready_list *));
static rtx ready_remove_first PARAMS ((struct ready_list *));
static rtx *ready_lastpos (struct ready_list *);
static void ready_sort (struct ready_list *);
static rtx ready_remove_first (struct ready_list *);
static void queue_to_ready PARAMS ((struct ready_list *));
static void queue_to_ready (struct ready_list *);
static void debug_ready_list PARAMS ((struct ready_list *));
static void debug_ready_list (struct ready_list *);
static rtx move_insn1 PARAMS ((rtx, rtx));
static rtx move_insn PARAMS ((rtx, rtx));
static rtx move_insn1 (rtx, rtx);
static rtx move_insn (rtx, rtx);
/* The following functions are used to implement multi-pass scheduling
on the first cycle. It is used only for DFA based scheduler. */
static rtx ready_element PARAMS ((struct ready_list *, int));
static rtx ready_remove PARAMS ((struct ready_list *, int));
static int max_issue PARAMS ((struct ready_list *, int *));
static rtx ready_element (struct ready_list *, int);
static rtx ready_remove (struct ready_list *, int);
static int max_issue (struct ready_list *, int *);
static rtx choose_ready PARAMS ((struct ready_list *));
static rtx choose_ready (struct ready_list *);
#endif /* INSN_SCHEDULING */
@ -542,8 +538,7 @@ struct sched_info *current_sched_info;
#ifndef INSN_SCHEDULING
void
schedule_insns (dump_file)
FILE *dump_file ATTRIBUTE_UNUSED;
schedule_insns (FILE *dump_file ATTRIBUTE_UNUSED)
{
}
#else
@ -562,8 +557,7 @@ static rtx last_scheduled_insn;
should never use the following function. */
HAIFA_INLINE int
insn_unit (insn)
rtx insn;
insn_unit (rtx insn)
{
int unit = INSN_UNIT (insn);
@ -601,9 +595,7 @@ insn_unit (insn)
function. */
HAIFA_INLINE static unsigned int
blockage_range (unit, insn)
int unit;
rtx insn;
blockage_range (int unit, rtx insn)
{
unsigned int blockage = INSN_BLOCKAGE (insn);
unsigned int range;
@ -656,8 +648,7 @@ static int unit_n_insns[1];
following function. */
rtx
get_unit_last_insn (instance)
int instance;
get_unit_last_insn (int instance)
{
return unit_last_insn[instance];
}
@ -665,7 +656,7 @@ get_unit_last_insn (instance)
/* Reset the function unit state to the null state. */
static void
clear_units ()
clear_units (void)
{
memset ((char *) unit_last_insn, 0, sizeof (unit_last_insn));
memset ((char *) unit_tick, 0, sizeof (unit_tick));
@ -676,8 +667,7 @@ clear_units ()
description should never use the following function. */
HAIFA_INLINE int
insn_issue_delay (insn)
rtx insn;
insn_issue_delay (rtx insn)
{
int i, delay = 0;
int unit = insn_unit (insn);
@ -707,9 +697,7 @@ insn_issue_delay (insn)
use the following function. */
HAIFA_INLINE int
actual_hazard_this_instance (unit, instance, insn, clock, cost)
int unit, instance, clock, cost;
rtx insn;
actual_hazard_this_instance (int unit, int instance, rtx insn, int clock, int cost)
{
int tick = unit_tick[instance]; /* Issue time of the last issued insn. */
@ -745,9 +733,7 @@ actual_hazard_this_instance (unit, instance, insn, clock, cost)
never use the following function. */
HAIFA_INLINE static void
schedule_unit (unit, insn, clock)
int unit, clock;
rtx insn;
schedule_unit (int unit, rtx insn, int clock)
{
int i;
@ -779,9 +765,7 @@ schedule_unit (unit, insn, clock)
use the following function. */
HAIFA_INLINE static int
actual_hazard (unit, insn, clock, cost)
int unit, clock, cost;
rtx insn;
actual_hazard (int unit, rtx insn, int clock, int cost)
{
int i;
@ -830,9 +814,7 @@ actual_hazard (unit, insn, clock, cost)
the following function. */
HAIFA_INLINE static int
potential_hazard (unit, insn, cost)
int unit, cost;
rtx insn;
potential_hazard (int unit, rtx insn, int cost)
{
int i, ncost;
unsigned int minb, maxb;
@ -875,8 +857,7 @@ potential_hazard (unit, insn, cost)
instruction results. */
HAIFA_INLINE int
insn_cost (insn, link, used)
rtx insn, link, used;
insn_cost (rtx insn, rtx link, rtx used)
{
int cost = INSN_COST (insn);
@ -898,10 +879,10 @@ insn_cost (insn, link, used)
cost = insn_default_latency (insn);
else
cost = result_ready_cost (insn);
if (cost < 0)
cost = 0;
INSN_COST (insn) = cost;
}
}
@ -942,15 +923,14 @@ insn_cost (insn, link, used)
if (cost < 0)
cost = 0;
}
return cost;
}
/* Compute the priority number for INSN. */
static int
priority (insn)
rtx insn;
priority (rtx insn)
{
rtx link;
@ -1006,9 +986,7 @@ while (0)
unstable. */
static int
rank_for_schedule (x, y)
const void *x;
const void *y;
rank_for_schedule (const void *x, const void *y)
{
rtx tmp = *(const rtx *) y;
rtx tmp2 = *(const rtx *) x;
@ -1087,9 +1065,7 @@ rank_for_schedule (x, y)
/* Resort the array A in which only element at index N may be out of order. */
HAIFA_INLINE static void
swap_sort (a, n)
rtx *a;
int n;
swap_sort (rtx *a, int n)
{
rtx insn = a[n - 1];
int i = n - 2;
@ -1107,9 +1083,7 @@ swap_sort (a, n)
chain for debugging purposes. */
HAIFA_INLINE static void
queue_insn (insn, n_cycles)
rtx insn;
int n_cycles;
queue_insn (rtx insn, int n_cycles)
{
int next_q = NEXT_Q_AFTER (q_ptr, n_cycles);
rtx link = alloc_INSN_LIST (insn, insn_queue[next_q]);
@ -1129,8 +1103,7 @@ queue_insn (insn, n_cycles)
with the lowest priority. */
HAIFA_INLINE static rtx *
ready_lastpos (ready)
struct ready_list *ready;
ready_lastpos (struct ready_list *ready)
{
if (ready->n_ready == 0)
abort ();
@ -1141,9 +1114,7 @@ ready_lastpos (ready)
priority. */
HAIFA_INLINE void
ready_add (ready, insn)
struct ready_list *ready;
rtx insn;
ready_add (struct ready_list *ready, rtx insn)
{
if (ready->first == ready->n_ready)
{
@ -1160,8 +1131,7 @@ ready_add (ready, insn)
return it. */
HAIFA_INLINE static rtx
ready_remove_first (ready)
struct ready_list *ready;
ready_remove_first (struct ready_list *ready)
{
rtx t;
if (ready->n_ready == 0)
@ -1183,9 +1153,7 @@ ready_remove_first (ready)
N_READY - 1. */
HAIFA_INLINE static rtx
ready_element (ready, index)
struct ready_list *ready;
int index;
ready_element (struct ready_list *ready, int index)
{
#ifdef ENABLE_CHECKING
if (ready->n_ready == 0 || index >= ready->n_ready)
@ -1199,9 +1167,7 @@ ready_element (ready, index)
has N_READY - 1. */
HAIFA_INLINE static rtx
ready_remove (ready, index)
struct ready_list *ready;
int index;
ready_remove (struct ready_list *ready, int index)
{
rtx t;
int i;
@ -1222,8 +1188,7 @@ ready_remove (ready, index)
macro. */
HAIFA_INLINE static void
ready_sort (ready)
struct ready_list *ready;
ready_sort (struct ready_list *ready)
{
rtx *first = ready_lastpos (ready);
SCHED_SORT (first, ready->n_ready);
@ -1234,8 +1199,7 @@ ready_sort (ready)
provide a hook for the target to tweek itself. */
HAIFA_INLINE static void
adjust_priority (prev)
rtx prev;
adjust_priority (rtx prev)
{
/* ??? There used to be code here to try and estimate how an insn
affected register lifetimes, but it did it by looking at REG_DEAD
@ -1251,7 +1215,7 @@ adjust_priority (prev)
/* Advance time on one cycle. */
HAIFA_INLINE static void
advance_one_cycle ()
advance_one_cycle (void)
{
if (targetm.sched.use_dfa_pipeline_interface
&& (*targetm.sched.use_dfa_pipeline_interface) ())
@ -1278,10 +1242,7 @@ static int last_clock_var;
zero for insns in a schedule group). */
static int
schedule_insn (insn, ready, clock)
rtx insn;
struct ready_list *ready;
int clock;
schedule_insn (rtx insn, struct ready_list *ready, int clock)
{
rtx link;
int advance = 0;
@ -1324,7 +1285,7 @@ schedule_insn (insn, ready, clock)
if (MAX_BLOCKAGE > 1 || issue_rate > 1 || sched_verbose)
schedule_unit (unit, insn, clock);
if (INSN_DEPEND (insn) == 0)
return 0;
}
@ -1393,8 +1354,7 @@ schedule_insn (insn, ready, clock)
Returns the insn following the notes. */
static rtx
unlink_other_notes (insn, tail)
rtx insn, tail;
unlink_other_notes (rtx insn, rtx tail)
{
rtx prev = PREV_INSN (insn);
@ -1430,8 +1390,7 @@ unlink_other_notes (insn, tail)
they can be reused. Returns the insn following the notes. */
static rtx
unlink_line_notes (insn, tail)
rtx insn, tail;
unlink_line_notes (rtx insn, rtx tail)
{
rtx prev = PREV_INSN (insn);
@ -1461,10 +1420,7 @@ unlink_line_notes (insn, tail)
/* Return the head and tail pointers of BB. */
void
get_block_head_tail (b, headp, tailp)
int b;
rtx *headp;
rtx *tailp;
get_block_head_tail (int b, rtx *headp, rtx *tailp)
{
/* HEAD and TAIL delimit the basic block being scheduled. */
rtx head = BLOCK_HEAD (b);
@ -1491,8 +1447,7 @@ get_block_head_tail (b, headp, tailp)
/* Return nonzero if there are no real insns in the range [ HEAD, TAIL ]. */
int
no_real_insns_p (head, tail)
rtx head, tail;
no_real_insns_p (rtx head, rtx tail)
{
while (head != NEXT_INSN (tail))
{
@ -1508,8 +1463,7 @@ no_real_insns_p (head, tail)
block in which notes should be processed. */
void
rm_line_notes (head, tail)
rtx head, tail;
rm_line_notes (rtx head, rtx tail)
{
rtx next_tail;
rtx insn;
@ -1541,9 +1495,7 @@ rm_line_notes (head, tail)
the boundaries of the block in which notes should be processed. */
void
save_line_notes (b, head, tail)
int b;
rtx head, tail;
save_line_notes (int b, rtx head, rtx tail)
{
rtx next_tail;
@ -1569,8 +1521,7 @@ save_line_notes (b, head, tail)
be processed. */
void
restore_line_notes (head, tail)
rtx head, tail;
restore_line_notes (rtx head, rtx tail)
{
rtx line, note, prev, new;
int added_notes = 0;
@ -1633,7 +1584,7 @@ restore_line_notes (head, tail)
insns list. */
void
rm_redundant_line_notes ()
rm_redundant_line_notes (void)
{
rtx line = 0;
rtx insn = get_insns ();
@ -1682,9 +1633,7 @@ rm_redundant_line_notes ()
of notes ended by NOTE_LIST. */
void
rm_other_notes (head, tail)
rtx head;
rtx tail;
rm_other_notes (rtx head, rtx tail)
{
rtx next_tail;
rtx insn;
@ -1724,8 +1673,7 @@ rm_other_notes (head, tail)
a new register is not needed. */
static int
find_set_reg_weight (x)
rtx x;
find_set_reg_weight (rtx x)
{
if (GET_CODE (x) == CLOBBER
&& register_operand (SET_DEST (x), VOIDmode))
@ -1748,8 +1696,7 @@ find_set_reg_weight (x)
/* Calculate INSN_REG_WEIGHT for all insns of a block. */
static void
find_insn_reg_weight (b)
int b;
find_insn_reg_weight (int b)
{
rtx insn, next_tail, head, tail;
@ -1769,14 +1716,14 @@ find_insn_reg_weight (b)
x = PATTERN (insn);
reg_weight += find_set_reg_weight (x);
if (GET_CODE (x) == PARALLEL)
{
int j;
for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
{
x = XVECEXP (PATTERN (insn), 0, j);
{
int j;
for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
{
x = XVECEXP (PATTERN (insn), 0, j);
reg_weight += find_set_reg_weight (x);
}
}
}
}
/* Decrement weight for each register that dies here. */
for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
{
@ -1795,8 +1742,7 @@ static int clock_var;
/* Move insns that became ready to fire from queue to ready list. */
static void
queue_to_ready (ready)
struct ready_list *ready;
queue_to_ready (struct ready_list *ready)
{
rtx insn;
rtx link;
@ -1866,8 +1812,7 @@ queue_to_ready (ready)
/* Print the ready list for debugging purposes. Callable from debugger. */
static void
debug_ready_list (ready)
struct ready_list *ready;
debug_ready_list (struct ready_list *ready)
{
rtx *p;
int i;
@ -1887,8 +1832,7 @@ debug_ready_list (ready)
/* move_insn1: Remove INSN from insn chain, and link it after LAST insn. */
static rtx
move_insn1 (insn, last)
rtx insn, last;
move_insn1 (rtx insn, rtx last)
{
NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
@ -1910,9 +1854,7 @@ move_insn1 (insn, last)
output by the instruction scheduler. Return the new value of LAST. */
static rtx
reemit_notes (insn, last)
rtx insn;
rtx last;
reemit_notes (rtx insn, rtx last)
{
rtx note, retval;
@ -1941,8 +1883,7 @@ reemit_notes (insn, last)
return value from the first call to reemit_notes. */
static rtx
move_insn (insn, last)
rtx insn, last;
move_insn (rtx insn, rtx last)
{
rtx retval = NULL;
@ -2011,9 +1952,7 @@ static int cached_issue_rate = 0;
of the best insn in READY. The following function is used only for
first cycle multipass scheduling. */
static int
max_issue (ready, index)
struct ready_list *ready;
int *index;
max_issue (struct ready_list *ready, int *index)
{
int n, i, all, n_ready, best, delay, tries_num;
struct choice_entry *top;
@ -2089,8 +2028,7 @@ max_issue (ready, index)
cycle multipass scheduling. */
static rtx
choose_ready (ready)
struct ready_list *ready;
choose_ready (struct ready_list *ready)
{
int lookahead = 0;
@ -2133,8 +2071,7 @@ choose_ready (ready)
the instruction stream. */
rtx
sched_emit_insn (pat)
rtx pat;
sched_emit_insn (rtx pat)
{
rtx insn = emit_insn_after (pat, last_scheduled_insn);
last_scheduled_insn = insn;
@ -2145,9 +2082,7 @@ sched_emit_insn (pat)
possibly bringing insns from subsequent blocks in the same region. */
void
schedule_block (b, rgn_n_insns)
int b;
int rgn_n_insns;
schedule_block (int b, int rgn_n_insns)
{
struct ready_list ready;
int i, first_cycle_insn_p;
@ -2248,18 +2183,18 @@ schedule_block (b, rgn_n_insns)
start_clock_var = clock_var;
clock_var++;
advance_one_cycle ();
/* Add to the ready list all pending insns that can be issued now.
If there are no ready insns, increment clock until one
is ready and add all pending insns at that point to the ready
list. */
queue_to_ready (&ready);
if (ready.n_ready == 0)
abort ();
if (sched_verbose >= 2)
{
fprintf (sched_dump, ";;\t\tReady list after queue_to_ready: ");
@ -2273,7 +2208,7 @@ schedule_block (b, rgn_n_insns)
{
/* Sort the ready list based on priority. */
ready_sort (&ready);
if (sched_verbose >= 2)
{
fprintf (sched_dump, ";;\t\tReady list after ready_sort: ");
@ -2322,13 +2257,13 @@ schedule_block (b, rgn_n_insns)
|| state_dead_lock_p (curr_state)
|| !(*current_sched_info->schedule_more_p) ())
break;
/* Select and remove the insn from the ready list. */
if (sort_p)
insn = choose_ready (&ready);
else
insn = ready_remove_first (&ready);
if (targetm.sched.dfa_new_cycle
&& (*targetm.sched.dfa_new_cycle) (sched_dump, sched_verbose,
insn, last_clock_var,
@ -2337,7 +2272,7 @@ schedule_block (b, rgn_n_insns)
ready_add (&ready, insn);
break;
}
sort_p = TRUE;
memcpy (temp_state, curr_state, dfa_state_size);
if (recog_memoized (insn) < 0)
@ -2366,32 +2301,32 @@ schedule_block (b, rgn_n_insns)
{
int j;
rtx bubble;
for (j = 0;
(bubble = (*targetm.sched.dfa_bubble) (j))
!= NULL_RTX;
j++)
{
memcpy (temp_state, curr_state, dfa_state_size);
if (state_transition (temp_state, bubble) < 0
&& state_transition (temp_state, insn) < 0)
break;
}
if (bubble != NULL_RTX)
{
if (insert_schedule_bubbles_p)
{
rtx copy;
copy = copy_rtx (PATTERN (bubble));
emit_insn_after (copy, last_scheduled_insn);
last_scheduled_insn
= NEXT_INSN (last_scheduled_insn);
INSN_CODE (last_scheduled_insn)
= INSN_CODE (bubble);
/* Annotate the same for the first insns
scheduling by using mode. */
PUT_MODE (last_scheduled_insn,
@ -2399,20 +2334,20 @@ schedule_block (b, rgn_n_insns)
? clock_var - last_clock_var
: VOIDmode));
last_clock_var = clock_var;
if (sched_verbose >= 2)
{
fprintf (sched_dump,
";;\t\t--> scheduling bubble insn <<<%d>>>:reservation ",
INSN_UID (last_scheduled_insn));
if (recog_memoized (last_scheduled_insn)
< 0)
fprintf (sched_dump, "nothing");
else
print_reservation
(sched_dump, last_scheduled_insn);
fprintf (sched_dump, "\n");
}
}
@ -2447,7 +2382,7 @@ schedule_block (b, rgn_n_insns)
cycle_issued_insns++;
memcpy (curr_state, temp_state, dfa_state_size);
}
if (targetm.sched.variable_issue)
can_issue_more =
(*targetm.sched.variable_issue) (sched_dump, sched_verbose,
@ -2515,7 +2450,7 @@ schedule_block (b, rgn_n_insns)
if (!reload_completed)
{
rtx insn, link, next;
/* INSN_TICK (minimum clock tick at which the insn becomes
ready) may be not correct for the insn in the subsequent
blocks of the region. We should use a correct value of
@ -2580,8 +2515,7 @@ schedule_block (b, rgn_n_insns)
/* Set_priorities: compute priority of each insn in the block. */
int
set_priorities (head, tail)
rtx head, tail;
set_priorities (rtx head, rtx tail)
{
rtx insn;
int n_insn;
@ -2610,8 +2544,7 @@ set_priorities (head, tail)
for debugging output. */
void
sched_init (dump_file)
FILE *dump_file;
sched_init (FILE *dump_file)
{
int luid;
basic_block b;
@ -2659,14 +2592,14 @@ sched_init (dump_file)
{
if (targetm.sched.init_dfa_pre_cycle_insn)
(*targetm.sched.init_dfa_pre_cycle_insn) ();
if (targetm.sched.init_dfa_post_cycle_insn)
(*targetm.sched.init_dfa_post_cycle_insn) ();
if (targetm.sched.first_cycle_multipass_dfa_lookahead
&& targetm.sched.init_dfa_bubbles)
(*targetm.sched.init_dfa_bubbles) ();
dfa_start ();
dfa_state_size = state_size ();
curr_state = xmalloc (dfa_state_size);
@ -2757,7 +2690,7 @@ sched_init (dump_file)
/* Free global data used during insn scheduling. */
void
sched_finish ()
sched_finish (void)
{
free (h_i_d);

View File

@ -1,5 +1,5 @@
/* Hash tables.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@ -32,15 +32,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
existing entry with a potential new one. Also, the ability to
delete members from the table has been removed. */
static unsigned int calc_hash PARAMS ((const unsigned char *, unsigned int));
static void ht_expand PARAMS ((hash_table *));
static unsigned int calc_hash (const unsigned char *, unsigned int);
static void ht_expand (hash_table *);
/* Calculate the hash of the string STR of length LEN. */
static unsigned int
calc_hash (str, len)
const unsigned char *str;
unsigned int len;
calc_hash (const unsigned char *str, unsigned int len)
{
unsigned int n = len;
unsigned int r = 0;
@ -56,8 +54,7 @@ calc_hash (str, len)
/* Initialize an identifier hashtable. */
hash_table *
ht_create (order)
unsigned int order;
ht_create (unsigned int order)
{
unsigned int nslots = 1 << order;
hash_table *table;
@ -77,8 +74,7 @@ ht_create (order)
/* Frees all memory associated with a hash table. */
void
ht_destroy (table)
hash_table *table;
ht_destroy (hash_table *table)
{
obstack_free (&table->stack, NULL);
free (table->entries);
@ -94,11 +90,8 @@ ht_destroy (table)
CPP_ALLOCED and the item is assumed to be at the top of the
obstack. */
hashnode
ht_lookup (table, str, len, insert)
hash_table *table;
const unsigned char *str;
unsigned int len;
enum ht_lookup_option insert;
ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
enum ht_lookup_option insert)
{
unsigned int hash = calc_hash (str, len);
unsigned int hash2;
@ -158,8 +151,7 @@ ht_lookup (table, str, len, insert)
/* Double the size of a hash table, re-hashing existing entries. */
static void
ht_expand (table)
hash_table *table;
ht_expand (hash_table *table)
{
hashnode *nentries, *p, *limit;
unsigned int size, sizemask;
@ -200,10 +192,7 @@ ht_expand (table)
/* For all nodes in TABLE, callback CB with parameters TABLE->PFILE,
the node, and V. */
void
ht_forall (table, cb, v)
hash_table *table;
ht_cb cb;
const void *v;
ht_forall (hash_table *table, ht_cb cb, const void *v)
{
hashnode *p, *limit;
@ -221,8 +210,7 @@ ht_forall (table, cb, v)
/* Dump allocation statistics to stderr. */
void
ht_dump_statistics (table)
hash_table *table;
ht_dump_statistics (hash_table *table)
{
size_t nelts, nids, overhead, headers;
size_t total_bytes, longest, sum_of_squares;
@ -251,7 +239,7 @@ ht_dump_statistics (table)
nids++;
}
while (++p < limit);
nelts = table->nelements;
overhead = obstack_memory_used (&table->stack) - total_bytes;
headers = table->nslots * sizeof (hashnode);
@ -287,8 +275,7 @@ ht_dump_statistics (table)
/* Return the approximate positive square root of a number N. This is for
statistical reports, not code generation. */
double
approx_sqrt (x)
double x;
approx_sqrt (double x)
{
double s, d;

View File

@ -1,5 +1,5 @@
/* Hash tables.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@ -46,7 +46,7 @@ struct ht
hashnode *entries;
/* Call back. */
hashnode (*alloc_node) PARAMS ((hash_table *));
hashnode (*alloc_node) (hash_table *);
unsigned int nslots; /* Total slots in the entries array. */
unsigned int nelements; /* Number of live elements. */
@ -60,25 +60,25 @@ struct ht
};
/* Initialize the hashtable with 2 ^ order entries. */
extern hash_table *ht_create PARAMS ((unsigned int order));
extern hash_table *ht_create (unsigned int order);
/* Frees all memory associated with a hash table. */
extern void ht_destroy PARAMS ((hash_table *));
extern void ht_destroy (hash_table *);
extern hashnode ht_lookup PARAMS ((hash_table *, const unsigned char *,
unsigned int, enum ht_lookup_option));
extern hashnode ht_lookup (hash_table *, const unsigned char *,
unsigned int, enum ht_lookup_option);
/* For all nodes in TABLE, make a callback. The callback takes
TABLE->PFILE, the node, and a PTR, and the callback sequence stops
if the callback returns zero. */
typedef int (*ht_cb) PARAMS ((struct cpp_reader *, hashnode, const void *));
extern void ht_forall PARAMS ((hash_table *, ht_cb, const void *));
typedef int (*ht_cb) (struct cpp_reader *, hashnode, const void *);
extern void ht_forall (hash_table *, ht_cb, const void *);
/* Dump allocation statistics to stderr. */
extern void ht_dump_statistics PARAMS ((hash_table *));
extern void ht_dump_statistics (hash_table *);
/* Approximate positive square root of a host double. This is for
statistical reports, not code generation. */
extern double approx_sqrt PARAMS ((double));
extern double approx_sqrt (double);
#endif /* GCC_HASHTABLE_H */

View File

@ -30,13 +30,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* Generic hook that does absolutely zappo. */
void
hook_void_void ()
hook_void_void (void)
{
}
/* Generic hook that takes no arguments and returns false. */
bool
hook_bool_void_false ()
hook_bool_void_false (void)
{
return false;
}
@ -58,63 +58,53 @@ hook_bool_bool_false (bool a ATTRIBUTE_UNUSED)
/* Generic hook that takes (tree, int) and does nothing. */
void
hook_void_tree_int (a, b)
tree a ATTRIBUTE_UNUSED;
int b ATTRIBUTE_UNUSED;
hook_void_tree_int (tree a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED)
{
}
/* Generic hook that takes (FILE *, const char *) and does nothing. */
void
hook_void_FILEptr_constcharptr (a, b)
FILE *a ATTRIBUTE_UNUSED;
const char *b ATTRIBUTE_UNUSED;
hook_void_FILEptr_constcharptr (FILE *a ATTRIBUTE_UNUSED, const char *b ATTRIBUTE_UNUSED)
{
}
/* Used for the TARGET_ASM_CAN_OUTPUT_MI_THUNK hook. */
bool
hook_bool_tree_hwi_hwi_tree_false (a, b, c, d)
tree a ATTRIBUTE_UNUSED;
HOST_WIDE_INT b ATTRIBUTE_UNUSED;
HOST_WIDE_INT c ATTRIBUTE_UNUSED;
tree d ATTRIBUTE_UNUSED;
hook_bool_tree_hwi_hwi_tree_false (tree a ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT c ATTRIBUTE_UNUSED,
tree d ATTRIBUTE_UNUSED)
{
return false;
}
bool
hook_bool_tree_hwi_hwi_tree_true (a, b, c, d)
tree a ATTRIBUTE_UNUSED;
HOST_WIDE_INT b ATTRIBUTE_UNUSED;
HOST_WIDE_INT c ATTRIBUTE_UNUSED;
tree d ATTRIBUTE_UNUSED;
hook_bool_tree_hwi_hwi_tree_true (tree a ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT c ATTRIBUTE_UNUSED,
tree d ATTRIBUTE_UNUSED)
{
return true;
}
bool
default_can_output_mi_thunk_no_vcall (a, b, c, d)
tree a ATTRIBUTE_UNUSED;
HOST_WIDE_INT b ATTRIBUTE_UNUSED;
HOST_WIDE_INT c;
tree d ATTRIBUTE_UNUSED;
default_can_output_mi_thunk_no_vcall (tree a ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT c,
tree d ATTRIBUTE_UNUSED)
{
return c == 0;
}
/* ??? Used for comp_type_attributes, which ought to return bool. */
int
hook_int_tree_tree_1 (a, b)
tree a ATTRIBUTE_UNUSED;
tree b ATTRIBUTE_UNUSED;
hook_int_tree_tree_1 (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
{
return 1;
}
int
hook_int_rtx_0 (a)
rtx a ATTRIBUTE_UNUSED;
hook_int_rtx_0 (rtx a ATTRIBUTE_UNUSED)
{
return 0;
}
@ -141,62 +131,52 @@ hook_uint_uint_constcharptrptr_0 (unsigned int a ATTRIBUTE_UNUSED,
}
void
hook_void_tree (a)
tree a ATTRIBUTE_UNUSED;
hook_void_tree (tree a ATTRIBUTE_UNUSED)
{
}
void
hook_void_tree_treeptr (a, b)
tree a ATTRIBUTE_UNUSED;
tree *b ATTRIBUTE_UNUSED;
hook_void_tree_treeptr (tree a ATTRIBUTE_UNUSED, tree *b ATTRIBUTE_UNUSED)
{
}
bool
hook_bool_tree_false (a)
tree a ATTRIBUTE_UNUSED;
hook_bool_tree_false (tree a ATTRIBUTE_UNUSED)
{
return false;
}
bool
hook_bool_tree_tree_false (a, b)
tree a ATTRIBUTE_UNUSED;
tree b ATTRIBUTE_UNUSED;
hook_bool_tree_tree_false (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
{
return false;
}
bool
hook_bool_rtx_false (a)
rtx a ATTRIBUTE_UNUSED;
hook_bool_rtx_false (rtx a ATTRIBUTE_UNUSED)
{
return false;
}
bool
hook_bool_rtx_int_int_intp_false (a, b, c, d)
rtx a ATTRIBUTE_UNUSED;
int b ATTRIBUTE_UNUSED;
int c ATTRIBUTE_UNUSED;
int *d ATTRIBUTE_UNUSED;
hook_bool_rtx_int_int_intp_false (rtx a ATTRIBUTE_UNUSED,
int b ATTRIBUTE_UNUSED,
int c ATTRIBUTE_UNUSED,
int *d ATTRIBUTE_UNUSED)
{
return false;
}
/* Generic hook that takes an rtx and returns it. */
rtx
hook_rtx_rtx_identity (x)
rtx x;
hook_rtx_rtx_identity (rtx x)
{
return x;
}
/* Generic hook that takes an rtx and returns NULL_RTX. */
rtx
hook_rtx_rtx_null (x)
rtx x ATTRIBUTE_UNUSED;
hook_rtx_rtx_null (rtx x ATTRIBUTE_UNUSED)
{
return 0;
}

View File

@ -22,36 +22,36 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef GCC_HOOKS_H
#define GCC_HOOKS_H
bool hook_bool_void_false PARAMS ((void));
bool hook_bool_void_false (void);
bool hook_bool_bool_false (bool);
bool hook_bool_tree_false PARAMS ((tree));
bool hook_bool_tree_hwi_hwi_tree_false
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
bool hook_bool_tree_hwi_hwi_tree_true
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
bool hook_bool_rtx_false PARAMS ((rtx));
bool hook_bool_rtx_int_int_intp_false PARAMS ((rtx, int, int, int *));
bool hook_bool_tree_false (tree);
bool hook_bool_tree_hwi_hwi_tree_false (tree, HOST_WIDE_INT, HOST_WIDE_INT,
tree);
bool hook_bool_tree_hwi_hwi_tree_true (tree, HOST_WIDE_INT, HOST_WIDE_INT,
tree);
bool hook_bool_rtx_false (rtx);
bool hook_bool_rtx_int_int_intp_false (rtx, int, int, int *);
void hook_void_tree_int PARAMS ((tree, int));
void hook_void_void PARAMS ((void));
void hook_void_FILEptr_constcharptr PARAMS ((FILE *, const char *));
void hook_void_tree PARAMS ((tree));
void hook_void_tree_treeptr PARAMS ((tree, tree *));
void hook_void_tree_int (tree, int);
void hook_void_void (void);
void hook_void_FILEptr_constcharptr (FILE *, const char *);
void hook_void_tree (tree);
void hook_void_tree_treeptr (tree, tree *);
int hook_int_tree_tree_1 PARAMS ((tree, tree));
int hook_int_rtx_0 PARAMS ((rtx));
int hook_int_tree_tree_1 (tree, tree);
int hook_int_rtx_0 (rtx);
int hook_int_void_0 (void);
int hook_int_size_t_constcharptr_int_0 (size_t, const char *, int);
int hook_int_void_no_regs (void);
unsigned hook_uint_uint_constcharptrptr_0 (unsigned, const char **);
bool default_can_output_mi_thunk_no_vcall
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
bool default_can_output_mi_thunk_no_vcall (tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree);
bool hook_bool_tree_tree_false PARAMS ((tree, tree));
bool hook_bool_tree_tree_false (tree, tree);
rtx hook_rtx_rtx_identity PARAMS ((rtx));
rtx hook_rtx_rtx_null PARAMS ((rtx));
rtx hook_rtx_rtx_identity (rtx);
rtx hook_rtx_rtx_null (rtx);
#endif

View File

@ -21,9 +21,9 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_HOST_HOOKS_H
#define GCC_HOST_HOOKS_H
struct host_hooks
struct host_hooks
{
void (*extra_signals) PARAMS((void));
void (*extra_signals) (void);
/* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
};

View File

@ -1,5 +1,5 @@
/* If-conversion support.
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -86,37 +86,35 @@ static bool life_data_ok;
static dominance_info post_dominators;
/* Forward references. */
static int count_bb_insns PARAMS ((basic_block));
static rtx first_active_insn PARAMS ((basic_block));
static rtx last_active_insn PARAMS ((basic_block, int));
static int seq_contains_jump PARAMS ((rtx));
static basic_block block_fallthru PARAMS ((basic_block));
static int cond_exec_process_insns PARAMS ((ce_if_block_t *,
rtx, rtx, rtx, rtx, int));
static rtx cond_exec_get_condition PARAMS ((rtx));
static int cond_exec_process_if_block PARAMS ((ce_if_block_t *, int));
static rtx noce_get_condition PARAMS ((rtx, rtx *));
static int noce_operand_ok PARAMS ((rtx));
static int noce_process_if_block PARAMS ((ce_if_block_t *));
static int process_if_block PARAMS ((ce_if_block_t *));
static void merge_if_block PARAMS ((ce_if_block_t *));
static int find_cond_trap PARAMS ((basic_block, edge, edge));
static basic_block find_if_header PARAMS ((basic_block, int));
static int block_jumps_and_fallthru_p PARAMS ((basic_block, basic_block));
static int find_if_block PARAMS ((ce_if_block_t *));
static int find_if_case_1 PARAMS ((basic_block, edge, edge));
static int find_if_case_2 PARAMS ((basic_block, edge, edge));
static int find_memory PARAMS ((rtx *, void *));
static int dead_or_predicable PARAMS ((basic_block, basic_block,
basic_block, basic_block, int));
static void noce_emit_move_insn PARAMS ((rtx, rtx));
static rtx block_has_only_trap PARAMS ((basic_block));
static int count_bb_insns (basic_block);
static rtx first_active_insn (basic_block);
static rtx last_active_insn (basic_block, int);
static int seq_contains_jump (rtx);
static basic_block block_fallthru (basic_block);
static int cond_exec_process_insns (ce_if_block_t *, rtx, rtx, rtx, rtx, int);
static rtx cond_exec_get_condition (rtx);
static int cond_exec_process_if_block (ce_if_block_t *, int);
static rtx noce_get_condition (rtx, rtx *);
static int noce_operand_ok (rtx);
static int noce_process_if_block (ce_if_block_t *);
static int process_if_block (ce_if_block_t *);
static void merge_if_block (ce_if_block_t *);
static int find_cond_trap (basic_block, edge, edge);
static basic_block find_if_header (basic_block, int);
static int block_jumps_and_fallthru_p (basic_block, basic_block);
static int find_if_block (ce_if_block_t *);
static int find_if_case_1 (basic_block, edge, edge);
static int find_if_case_2 (basic_block, edge, edge);
static int find_memory (rtx *, void *);
static int dead_or_predicable (basic_block, basic_block, basic_block,
basic_block, int);
static void noce_emit_move_insn (rtx, rtx);
static rtx block_has_only_trap (basic_block);
/* Count the number of non-jump active insns in BB. */
static int
count_bb_insns (bb)
basic_block bb;
count_bb_insns (basic_block bb)
{
int count = 0;
rtx insn = bb->head;
@ -137,8 +135,7 @@ count_bb_insns (bb)
/* Return the first non-jump active insn in the basic block. */
static rtx
first_active_insn (bb)
basic_block bb;
first_active_insn (basic_block bb)
{
rtx insn = bb->head;
@ -165,9 +162,7 @@ first_active_insn (bb)
/* Return the last non-jump active (non-jump) insn in the basic block. */
static rtx
last_active_insn (bb, skip_use_p)
basic_block bb;
int skip_use_p;
last_active_insn (basic_block bb, int skip_use_p)
{
rtx insn = bb->end;
rtx head = bb->head;
@ -189,14 +184,13 @@ last_active_insn (bb, skip_use_p)
return insn;
}
/* It is possible, especially when having dealt with multi-word
/* It is possible, especially when having dealt with multi-word
arithmetic, for the expanders to have emitted jumps. Search
through the sequence and return TRUE if a jump exists so that
we can abort the conversion. */
static int
seq_contains_jump (insn)
rtx insn;
seq_contains_jump (rtx insn)
{
while (insn)
{
@ -208,8 +202,7 @@ seq_contains_jump (insn)
}
static basic_block
block_fallthru (bb)
basic_block bb;
block_fallthru (basic_block bb)
{
edge e;
@ -226,13 +219,12 @@ block_fallthru (bb)
insns were processed. */
static int
cond_exec_process_insns (ce_info, start, end, test, prob_val, mod_ok)
ce_if_block_t *ce_info ATTRIBUTE_UNUSED; /* if block information */
rtx start; /* first insn to look at */
rtx end; /* last insn to look at */
rtx test; /* conditional execution test */
rtx prob_val; /* probability of branch taken. */
int mod_ok; /* true if modifications ok last insn. */
cond_exec_process_insns (ce_if_block_t *ce_info ATTRIBUTE_UNUSED,
/* if block information */rtx start,
/* first insn to look at */rtx end,
/* last insn to look at */rtx test,
/* conditional execution test */rtx prob_val,
/* probability of branch taken. */int mod_ok)
{
int must_be_last = FALSE;
rtx insn;
@ -253,7 +245,7 @@ cond_exec_process_insns (ce_info, start, end, test, prob_val, mod_ok)
/* Remove USE insns that get in the way. */
if (reload_completed && GET_CODE (PATTERN (insn)) == USE)
{
/* ??? Ug. Actually unlinking the thing is problematic,
/* ??? Ug. Actually unlinking the thing is problematic,
given what we'd have to coordinate with our callers. */
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
@ -317,8 +309,7 @@ cond_exec_process_insns (ce_info, start, end, test, prob_val, mod_ok)
/* Return the condition for a jump. Do not do any special processing. */
static rtx
cond_exec_get_condition (jump)
rtx jump;
cond_exec_get_condition (rtx jump)
{
rtx test_if, cond;
@ -349,9 +340,8 @@ cond_exec_get_condition (jump)
converting the block. */
static int
cond_exec_process_if_block (ce_info, do_multiple_p)
ce_if_block_t * ce_info; /* if block information */
int do_multiple_p; /* != 0 if we should handle && and || blocks */
cond_exec_process_if_block (ce_if_block_t * ce_info,
/* if block information */int do_multiple_p)
{
basic_block test_bb = ce_info->test_bb; /* last test block */
basic_block then_bb = ce_info->then_bb; /* THEN */
@ -416,7 +406,7 @@ cond_exec_process_if_block (ce_info, do_multiple_p)
/* Map test_expr/test_jump into the appropriate MD tests to use on
the conditionally executed code. */
true_expr = test_expr;
false_code = reversed_comparison_code (true_expr, test_bb->end);
@ -566,10 +556,10 @@ cond_exec_process_if_block (ce_info, do_multiple_p)
return FALSE;
}
/* Used by noce_process_if_block to communicate with its subroutines.
/* Used by noce_process_if_block to communicate with its subroutines.
The subroutines know that A and B may be evaluated freely. They
know that X is a register. They should insert new instructions
know that X is a register. They should insert new instructions
before cond_earliest. */
struct noce_if_info
@ -580,29 +570,24 @@ struct noce_if_info
rtx jump, cond, cond_earliest;
};
static rtx noce_emit_store_flag PARAMS ((struct noce_if_info *,
rtx, int, int));
static int noce_try_store_flag PARAMS ((struct noce_if_info *));
static int noce_try_addcc PARAMS ((struct noce_if_info *));
static int noce_try_store_flag_constants PARAMS ((struct noce_if_info *));
static int noce_try_store_flag_mask PARAMS ((struct noce_if_info *));
static rtx noce_emit_cmove PARAMS ((struct noce_if_info *,
rtx, enum rtx_code, rtx,
rtx, rtx, rtx));
static int noce_try_cmove PARAMS ((struct noce_if_info *));
static int noce_try_cmove_arith PARAMS ((struct noce_if_info *));
static rtx noce_get_alt_condition PARAMS ((struct noce_if_info *,
rtx, rtx *));
static int noce_try_minmax PARAMS ((struct noce_if_info *));
static int noce_try_abs PARAMS ((struct noce_if_info *));
static rtx noce_emit_store_flag (struct noce_if_info *, rtx, int, int);
static int noce_try_store_flag (struct noce_if_info *);
static int noce_try_addcc (struct noce_if_info *);
static int noce_try_store_flag_constants (struct noce_if_info *);
static int noce_try_store_flag_mask (struct noce_if_info *);
static rtx noce_emit_cmove (struct noce_if_info *, rtx, enum rtx_code, rtx,
rtx, rtx, rtx);
static int noce_try_cmove (struct noce_if_info *);
static int noce_try_cmove_arith (struct noce_if_info *);
static rtx noce_get_alt_condition (struct noce_if_info *, rtx, rtx *);
static int noce_try_minmax (struct noce_if_info *);
static int noce_try_abs (struct noce_if_info *);
/* Helper function for noce_try_store_flag*. */
static rtx
noce_emit_store_flag (if_info, x, reversep, normalize)
struct noce_if_info *if_info;
rtx x;
int reversep, normalize;
noce_emit_store_flag (struct noce_if_info *if_info, rtx x, int reversep,
int normalize)
{
rtx cond = if_info->cond;
int cond_complex;
@ -660,8 +645,7 @@ noce_emit_store_flag (if_info, x, reversep, normalize)
/* Emit instruction to move an rtx into STRICT_LOW_PART. */
static void
noce_emit_move_insn (x, y)
rtx x, y;
noce_emit_move_insn (rtx x, rtx y)
{
enum machine_mode outmode, inmode;
rtx outer, inner;
@ -689,8 +673,7 @@ noce_emit_move_insn (x, y)
a go at the conversion. */
static int
noce_try_store_flag (if_info)
struct noce_if_info *if_info;
noce_try_store_flag (struct noce_if_info *if_info)
{
int reversep;
rtx target, seq;
@ -732,8 +715,7 @@ noce_try_store_flag (if_info)
/* Convert "if (test) x = a; else x = b", for A and B constant. */
static int
noce_try_store_flag_constants (if_info)
struct noce_if_info *if_info;
noce_try_store_flag_constants (struct noce_if_info *if_info)
{
rtx target, seq;
int reversep;
@ -783,7 +765,7 @@ noce_try_store_flag_constants (if_info)
return FALSE;
if (reversep)
{
{
tmp = itrue; itrue = ifalse; ifalse = tmp;
diff = trunc_int_for_mode (-diff, mode);
}
@ -861,12 +843,11 @@ noce_try_store_flag_constants (if_info)
return FALSE;
}
/* Convert "if (test) foo++" into "foo += (test != 0)", and
/* Convert "if (test) foo++" into "foo += (test != 0)", and
similarly for "foo--". */
static int
noce_try_addcc (if_info)
struct noce_if_info *if_info;
noce_try_addcc (struct noce_if_info *if_info)
{
rtx target, seq;
int subtract, normalize;
@ -907,7 +888,7 @@ noce_try_addcc (if_info)
}
end_sequence ();
}
/* If that fails, construct conditional increment or decrement using
setcc. */
if (BRANCH_COST >= 2
@ -958,8 +939,7 @@ noce_try_addcc (if_info)
/* Convert "if (test) x = 0;" to "x &= -(test == 0);" */
static int
noce_try_store_flag_mask (if_info)
struct noce_if_info *if_info;
noce_try_store_flag_mask (struct noce_if_info *if_info)
{
rtx target, seq;
int reversep;
@ -1011,10 +991,8 @@ noce_try_store_flag_mask (if_info)
/* Helper function for noce_try_cmove and noce_try_cmove_arith. */
static rtx
noce_emit_cmove (if_info, x, code, cmp_a, cmp_b, vfalse, vtrue)
struct noce_if_info *if_info;
rtx x, cmp_a, cmp_b, vfalse, vtrue;
enum rtx_code code;
noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
rtx cmp_a, rtx cmp_b, rtx vfalse, rtx vtrue)
{
/* If earliest == jump, try to build the cmove insn directly.
This is helpful when combine has created some complex condition
@ -1057,7 +1035,7 @@ noce_emit_cmove (if_info, x, code, cmp_a, cmp_b, vfalse, vtrue)
#else
/* We'll never get here, as noce_process_if_block doesn't call the
functions involved. Ifdef code, however, should be discouraged
because it leads to typos in the code not selected. However,
because it leads to typos in the code not selected. However,
emit_conditional_move won't exist either. */
return NULL_RTX;
#endif
@ -1068,8 +1046,7 @@ noce_emit_cmove (if_info, x, code, cmp_a, cmp_b, vfalse, vtrue)
has had a go at it. */
static int
noce_try_cmove (if_info)
struct noce_if_info *if_info;
noce_try_cmove (struct noce_if_info *if_info)
{
enum rtx_code code;
rtx target, seq;
@ -1109,8 +1086,7 @@ noce_try_cmove (if_info)
/* Try more complex cases involving conditional_move. */
static int
noce_try_cmove_arith (if_info)
struct noce_if_info *if_info;
noce_try_cmove_arith (struct noce_if_info *if_info)
{
rtx a = if_info->a;
rtx b = if_info->b;
@ -1146,7 +1122,7 @@ noce_try_cmove_arith (if_info)
if (test)
x = y;
*/
code = GET_CODE (if_info->cond);
insn_a = if_info->insn_a;
insn_b = if_info->insn_b;
@ -1172,7 +1148,7 @@ noce_try_cmove_arith (if_info)
/* If either operand is complex, load it into a register first.
The best way to do this is to copy the original insn. In this
way we preserve any clobbers etc that the insn may have had.
way we preserve any clobbers etc that the insn may have had.
This is of course not possible in the IS_MEM case. */
if (! general_operand (a, GET_MODE (a)))
{
@ -1268,10 +1244,8 @@ noce_try_cmove_arith (if_info)
For these we wish to know that it is A or B in the condition. */
static rtx
noce_get_alt_condition (if_info, target, earliest)
struct noce_if_info *if_info;
rtx target;
rtx *earliest;
noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
rtx *earliest)
{
rtx cond, set, insn;
int reverse;
@ -1417,9 +1391,8 @@ noce_get_alt_condition (if_info, target, earliest)
/* Convert "if (a < b) x = a; else x = b;" to "x = min(a, b);", etc. */
static int
noce_try_minmax (if_info)
struct noce_if_info *if_info;
{
noce_try_minmax (struct noce_if_info *if_info)
{
rtx cond, earliest, target, seq;
enum rtx_code code, op;
int unsignedp;
@ -1502,7 +1475,7 @@ noce_try_minmax (if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
end_sequence ();
end_sequence ();
if (seq_contains_jump (seq))
return FALSE;
@ -1517,9 +1490,8 @@ noce_try_minmax (if_info)
/* Convert "if (a < 0) x = -a; else x = a;" to "x = abs(a);", etc. */
static int
noce_try_abs (if_info)
struct noce_if_info *if_info;
{
noce_try_abs (struct noce_if_info *if_info)
{
rtx cond, earliest, target, seq, a, b, c;
int negate;
@ -1539,7 +1511,7 @@ noce_try_abs (if_info)
}
else
return FALSE;
cond = noce_get_alt_condition (if_info, b, &earliest);
if (!cond)
return FALSE;
@ -1560,7 +1532,7 @@ noce_try_abs (if_info)
for (insn = earliest;
insn != if_info->test_bb->head;
insn = PREV_INSN (insn))
if (INSN_P (insn)
if (INSN_P (insn)
&& ((note = find_reg_note (insn, REG_EQUAL, c))
|| (note = find_reg_note (insn, REG_EQUIV, c))))
break;
@ -1574,7 +1546,7 @@ noce_try_abs (if_info)
c = get_pool_constant (XEXP (c, 0));
/* Work around funny ideas get_condition has wrt canonicalization.
Note that these rtx constants are known to be CONST_INT, and
Note that these rtx constants are known to be CONST_INT, and
therefore imply integer comparisons. */
if (c == constm1_rtx && GET_CODE (cond) == GT)
;
@ -1620,7 +1592,7 @@ noce_try_abs (if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
end_sequence ();
end_sequence ();
if (seq_contains_jump (seq))
return FALSE;
@ -1636,9 +1608,7 @@ noce_try_abs (if_info)
valid at JUMP, instead of at EARLIEST. */
static rtx
noce_get_condition (jump, earliest)
rtx jump;
rtx *earliest;
noce_get_condition (rtx jump, rtx *earliest)
{
rtx cond, set, tmp, insn;
bool reverse;
@ -1704,8 +1674,7 @@ noce_get_condition (jump, earliest)
/* Return true if OP is ok for if-then-else processing. */
static int
noce_operand_ok (op)
rtx op;
noce_operand_ok (rtx op)
{
/* We special-case memories, so handle any of them with
no address side effects. */
@ -1723,8 +1692,7 @@ noce_operand_ok (op)
successful at converting the block. */
static int
noce_process_if_block (ce_info)
struct ce_if_block * ce_info;
noce_process_if_block (struct ce_if_block * ce_info)
{
basic_block test_bb = ce_info->test_bb; /* test block */
basic_block then_bb = ce_info->then_bb; /* THEN */
@ -1824,7 +1792,7 @@ noce_process_if_block (ce_info)
/* If x has side effects then only the if-then-else form is safe to
convert. But even in that case we would need to restore any notes
(such as REG_INC) at then end. That can be tricky if
(such as REG_INC) at then end. That can be tricky if
noce_emit_move_insn expands to more than one insn, so disable the
optimization entirely for now if there are side effects. */
if (side_effects_p (x))
@ -1890,7 +1858,7 @@ noce_process_if_block (ce_info)
x must be executed twice. */
else if (insn_b && side_effects_p (orig_x))
return FALSE;
x = orig_x;
goto success;
}
@ -1958,8 +1926,7 @@ noce_process_if_block (ce_info)
straight line code. Return true if successful. */
static int
process_if_block (ce_info)
struct ce_if_block * ce_info;
process_if_block (struct ce_if_block * ce_info)
{
if (! reload_completed
&& noce_process_if_block (ce_info))
@ -1989,8 +1956,7 @@ process_if_block (ce_info)
/* Merge the blocks and mark for local life update. */
static void
merge_if_block (ce_info)
struct ce_if_block * ce_info;
merge_if_block (struct ce_if_block * ce_info)
{
basic_block test_bb = ce_info->test_bb; /* last test block */
basic_block then_bb = ce_info->then_bb; /* THEN */
@ -2009,7 +1975,7 @@ merge_if_block (ce_info)
basic_block bb = test_bb;
basic_block last_test_bb = ce_info->last_test_bb;
basic_block fallthru = block_fallthru (bb);
do
{
bb = fallthru;
@ -2088,7 +2054,7 @@ merge_if_block (ce_info)
Since we've already merged the TEST, THEN and ELSE blocks, we should
have only one remaining edge from our if-then-else diamond. If there
is more than one remaining edge, it must come from elsewhere. There
may be zero incoming edges if the THEN block didn't actually join
may be zero incoming edges if the THEN block didn't actually join
back up (as with a call to abort). */
else if ((join_bb->pred == NULL
|| join_bb->pred->pred_next == NULL)
@ -2128,9 +2094,7 @@ merge_if_block (ce_info)
first block if some transformation was done. Return NULL otherwise. */
static basic_block
find_if_header (test_bb, pass)
basic_block test_bb;
int pass;
find_if_header (basic_block test_bb, int pass)
{
ce_if_block_t ce_info;
edge then_edge;
@ -2200,9 +2164,7 @@ find_if_header (test_bb, pass)
of non-note, non-jump, non-USE/CLOBBER insns in the block. */
static int
block_jumps_and_fallthru_p (cur_bb, target_bb)
basic_block cur_bb;
basic_block target_bb;
block_jumps_and_fallthru_p (basic_block cur_bb, basic_block target_bb)
{
edge cur_edge;
int fallthru_p = FALSE;
@ -2271,8 +2233,7 @@ block_jumps_and_fallthru_p (cur_bb, target_bb)
Return TRUE if we were successful at converting the block. */
static int
find_if_block (ce_info)
struct ce_if_block * ce_info;
find_if_block (struct ce_if_block * ce_info)
{
basic_block test_bb = ce_info->test_bb;
basic_block then_bb = ce_info->then_bb;
@ -2308,7 +2269,7 @@ find_if_block (ce_info)
}
else if ((n_insns = block_jumps_and_fallthru_p (bb, then_bb)) >= 0)
{
ce_info->and_and_p = FALSE;
ce_info->and_and_p = FALSE;
target_bb = then_bb;
}
else
@ -2429,7 +2390,7 @@ find_if_block (ce_info)
/* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */
else
return FALSE;
return FALSE;
num_possible_if_blocks++;
@ -2491,9 +2452,7 @@ find_if_block (ce_info)
to a trap, into a conditional trap. */
static int
find_cond_trap (test_bb, then_edge, else_edge)
basic_block test_bb;
edge then_edge, else_edge;
find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
{
basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest;
@ -2589,12 +2548,11 @@ find_cond_trap (test_bb, then_edge, else_edge)
return TRUE;
}
/* Subroutine of find_cond_trap: if BB contains only a trap insn,
/* Subroutine of find_cond_trap: if BB contains only a trap insn,
return it. */
static rtx
block_has_only_trap (bb)
basic_block bb;
block_has_only_trap (basic_block bb)
{
rtx trap;
@ -2694,9 +2652,7 @@ block_has_only_trap (bb)
/* Tests for case 1 above. */
static int
find_if_case_1 (test_bb, then_edge, else_edge)
basic_block test_bb;
edge then_edge, else_edge;
find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
{
basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest, new_bb;
@ -2730,7 +2686,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
return FALSE;
/* Registers set are dead, or are predicable. */
if (! dead_or_predicable (test_bb, then_bb, else_bb,
if (! dead_or_predicable (test_bb, then_bb, else_bb,
then_bb->succ->dest, 1))
return FALSE;
@ -2740,7 +2696,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
bitmap_operation (test_bb->global_live_at_end,
else_bb->global_live_at_start,
then_bb->global_live_at_end, BITMAP_IOR);
new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb);
then_bb_index = then_bb->index;
if (post_dominators)
@ -2768,9 +2724,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
/* Test for case 2 above. */
static int
find_if_case_2 (test_bb, then_edge, else_edge)
basic_block test_bb;
edge then_edge, else_edge;
find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
{
basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest;
@ -2798,7 +2752,7 @@ find_if_case_2 (test_bb, then_edge, else_edge)
if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2)
;
else if (else_succ->dest->index < 0
|| dominated_by_p (post_dominators, then_bb,
|| dominated_by_p (post_dominators, then_bb,
else_succ->dest))
;
else
@ -2824,7 +2778,7 @@ find_if_case_2 (test_bb, then_edge, else_edge)
bitmap_operation (test_bb->global_live_at_end,
then_bb->global_live_at_start,
else_bb->global_live_at_end, BITMAP_IOR);
if (post_dominators)
delete_from_dominance_info (post_dominators, else_bb);
delete_block (else_bb);
@ -2842,9 +2796,7 @@ find_if_case_2 (test_bb, then_edge, else_edge)
Return 1 if a memory is found. */
static int
find_memory (px, data)
rtx *px;
void *data ATTRIBUTE_UNUSED;
find_memory (rtx *px, void *data ATTRIBUTE_UNUSED)
{
return GET_CODE (*px) == MEM;
}
@ -2858,10 +2810,8 @@ find_memory (px, data)
REVERSEP is true if the sense of the branch should be reversed. */
static int
dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
basic_block test_bb, merge_bb, other_bb;
basic_block new_dest;
int reversep;
dead_or_predicable (basic_block test_bb, basic_block merge_bb,
basic_block other_bb, basic_block new_dest, int reversep)
{
rtx head, end, jump, earliest, old_dest, new_label = NULL_RTX;
@ -2986,7 +2936,7 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
test_set = INITIALIZE_REG_SET (test_set_head);
/* ??? bb->local_set is only valid during calculate_global_regs_live,
so we must recompute usage for MERGE_BB. Not so bad, I suppose,
so we must recompute usage for MERGE_BB. Not so bad, I suppose,
since we've already asserted that MERGE_BB is small. */
propagate_block (merge_bb, tmp, merge_set, merge_set, 0);
@ -3117,8 +3067,7 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
/* Main entry point for all if-conversion. */
void
if_convert (x_life_data_ok)
int x_life_data_ok;
if_convert (int x_life_data_ok)
{
basic_block bb;
int pass;

View File

@ -25,7 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* The data structure used to record a location in a translation unit. */
struct location_s GTY (())
{
/* The name of the source file involved. */
/* The name of the source file involved. */
const char *file;
/* The line-location in the source file. */
@ -53,7 +53,7 @@ extern struct file_stack *input_file_stack;
/* Incremented on each change to input_file_stack. */
extern int input_file_stack_tick;
extern void push_srcloc PARAMS ((const char *name, int line));
extern void pop_srcloc PARAMS ((void));
extern void push_srcloc (const char *name, int line);
extern void pop_srcloc (void);
#endif

View File

@ -74,28 +74,23 @@ typedef struct initial_value_struct GTY(()) {
initial_value_pair * GTY ((length ("%h.num_entries"))) entries;
} initial_value_struct;
static void setup_initial_hard_reg_value_integration PARAMS ((struct function *, struct inline_remap *));
static void setup_initial_hard_reg_value_integration (struct function *,
struct inline_remap *);
static rtvec initialize_for_inline PARAMS ((tree));
static void note_modified_parmregs PARAMS ((rtx, rtx, void *));
static void integrate_parm_decls PARAMS ((tree, struct inline_remap *,
rtvec));
static tree integrate_decl_tree PARAMS ((tree,
struct inline_remap *));
static void subst_constants PARAMS ((rtx *, rtx,
struct inline_remap *, int));
static void set_block_origin_self PARAMS ((tree));
static void set_block_abstract_flags PARAMS ((tree, int));
static void process_reg_param PARAMS ((struct inline_remap *, rtx,
rtx));
static void mark_stores PARAMS ((rtx, rtx, void *));
static void save_parm_insns PARAMS ((rtx, rtx));
static void copy_insn_list PARAMS ((rtx, struct inline_remap *,
rtx));
static void copy_insn_notes PARAMS ((rtx, struct inline_remap *,
int));
static int compare_blocks PARAMS ((const void *, const void *));
static int find_block PARAMS ((const void *, const void *));
static rtvec initialize_for_inline (tree);
static void note_modified_parmregs (rtx, rtx, void *);
static void integrate_parm_decls (tree, struct inline_remap *, rtvec);
static tree integrate_decl_tree (tree, struct inline_remap *);
static void subst_constants (rtx *, rtx, struct inline_remap *, int);
static void set_block_origin_self (tree);
static void set_block_abstract_flags (tree, int);
static void process_reg_param (struct inline_remap *, rtx, rtx);
static void mark_stores (rtx, rtx, void *);
static void save_parm_insns (rtx, rtx);
static void copy_insn_list (rtx, struct inline_remap *, rtx);
static void copy_insn_notes (rtx, struct inline_remap *, int);
static int compare_blocks (const void *, const void *);
static int find_block (const void *, const void *);
/* Used by copy_rtx_and_substitute; this indicates whether the function is
called for the purpose of inlining or some other purpose (i.e. loop
@ -109,9 +104,7 @@ static struct function *inlining = 0;
explosions when the label_map gets very large. */
rtx
get_label_from_map (map, i)
struct inline_remap *map;
int i;
get_label_from_map (struct inline_remap *map, int i)
{
rtx x = map->label_map[i];
@ -124,8 +117,7 @@ get_label_from_map (map, i)
/* Return false if the function FNDECL cannot be inlined on account of its
attributes, true otherwise. */
bool
function_attribute_inlinable_p (fndecl)
tree fndecl;
function_attribute_inlinable_p (tree fndecl)
{
if (targetm.attribute_table)
{
@ -151,8 +143,7 @@ function_attribute_inlinable_p (fndecl)
for the function's name. */
const char *
function_cannot_inline_p (fndecl)
tree fndecl;
function_cannot_inline_p (tree fndecl)
{
rtx insn;
tree last = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
@ -285,8 +276,7 @@ static int in_nonparm_insns;
needed to save FNDECL's insns and info for future inline expansion. */
static rtvec
initialize_for_inline (fndecl)
tree fndecl;
initialize_for_inline (tree fndecl)
{
int i;
rtvec arg_vector;
@ -337,10 +327,7 @@ initialize_for_inline (fndecl)
TO_FN. */
tree
copy_decl_for_inlining (decl, from_fn, to_fn)
tree decl;
tree from_fn;
tree to_fn;
copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn)
{
tree copy;
@ -441,8 +428,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
functions at the end of compilation. */
void
save_for_inline (fndecl)
tree fndecl;
save_for_inline (tree fndecl)
{
rtx insn;
rtvec argvec;
@ -518,9 +504,7 @@ save_for_inline (fndecl)
register and track the new register's life. */
static void
save_parm_insns (insn, first_nonparm_insn)
rtx insn;
rtx first_nonparm_insn;
save_parm_insns (rtx insn, rtx first_nonparm_insn)
{
if (insn == NULL_RTX)
return;
@ -554,10 +538,7 @@ save_parm_insns (insn, first_nonparm_insn)
/* Note whether a parameter is modified or not. */
static void
note_modified_parmregs (reg, x, data)
rtx reg;
rtx x ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
note_modified_parmregs (rtx reg, rtx x ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED)
{
if (GET_CODE (reg) == REG && in_nonparm_insns
&& REGNO (reg) < max_parm_reg
@ -588,9 +569,7 @@ varray_type global_const_equiv_varray;
Also, don't allow hard registers here; they might not be valid when
substituted into insns. */
static void
process_reg_param (map, loc, copy)
struct inline_remap *map;
rtx loc, copy;
process_reg_param (struct inline_remap *map, rtx loc, rtx copy)
{
if ((GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG)
|| (GET_CODE (copy) == REG && REG_USERVAR_P (loc)
@ -612,9 +591,7 @@ process_reg_param (map, loc, copy)
two pointers, because it may overflow sizeof(int). */
static int
compare_blocks (v1, v2)
const void *v1;
const void *v2;
compare_blocks (const void *v1, const void *v2)
{
tree b1 = *((const tree *) v1);
tree b2 = *((const tree *) v2);
@ -630,9 +607,7 @@ compare_blocks (v1, v2)
an original block; the second to a remapped equivalent. */
static int
find_block (v1, v2)
const void *v1;
const void *v2;
find_block (const void *v1, const void *v2)
{
const union tree_node *b1 = (const union tree_node *) v1;
tree b2 = *((const tree *) v2);
@ -658,13 +633,8 @@ find_block (v1, v2)
else an rtx for where the value is stored. */
rtx
expand_inline_function (fndecl, parms, target, ignore, type,
structure_value_addr)
tree fndecl, parms;
rtx target;
int ignore;
tree type;
rtx structure_value_addr;
expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
tree type, rtx structure_value_addr)
{
struct function *inlining_previous;
struct function *inl_f = DECL_SAVED_INSNS (fndecl);
@ -812,10 +782,10 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* If the formal type was const but the actual was not, we might
end up here with an rtx wrongly tagged unchanging in the caller's
context. Fix that. */
if (arg_vals[i] != 0
if (arg_vals[i] != 0
&& (GET_CODE (arg_vals[i]) == REG || GET_CODE (arg_vals[i]) == MEM)
&& ! TREE_READONLY (TREE_VALUE (actual)))
RTX_UNCHANGING_P (arg_vals[i]) = 0;
RTX_UNCHANGING_P (arg_vals[i]) = 0;
if (arg_vals[i] != 0
&& (! TREE_READONLY (formal)
@ -1039,7 +1009,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
REG_FUNCTION_RETURN_VALUE_P. */
map->inline_target = 0;
loc = (DECL_RTL_SET_P (DECL_RESULT (fndecl))
loc = (DECL_RTL_SET_P (DECL_RESULT (fndecl))
? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
if (TYPE_MODE (type) == VOIDmode)
@ -1348,10 +1318,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
register for the function. */
static void
copy_insn_list (insns, map, static_chain_value)
rtx insns;
struct inline_remap *map;
rtx static_chain_value;
copy_insn_list (rtx insns, struct inline_remap *map, rtx static_chain_value)
{
int i;
rtx insn;
@ -1732,10 +1699,7 @@ copy_insn_list (insns, map, static_chain_value)
that are valid across the entire function. */
static void
copy_insn_notes (insns, map, eh_region_offset)
rtx insns;
struct inline_remap *map;
int eh_region_offset;
copy_insn_notes (rtx insns, struct inline_remap *map, int eh_region_offset)
{
rtx insn, new_insn;
@ -1791,10 +1755,7 @@ copy_insn_notes (insns, map, eh_region_offset)
push all of those decls and give each one the corresponding home. */
static void
integrate_parm_decls (args, map, arg_vector)
tree args;
struct inline_remap *map;
rtvec arg_vector;
integrate_parm_decls (tree args, struct inline_remap *map, rtvec arg_vector)
{
tree tail;
int i;
@ -1827,9 +1788,7 @@ integrate_parm_decls (args, map, arg_vector)
no mapping is necessary. */
static tree
integrate_decl_tree (let, map)
tree let;
struct inline_remap *map;
integrate_decl_tree (tree let, struct inline_remap *map)
{
tree t;
tree new_block;
@ -1898,10 +1857,7 @@ integrate_decl_tree (let, map)
calling `force_const_mem'. */
rtx
copy_rtx_and_substitute (orig, map, for_lhs)
rtx orig;
struct inline_remap *map;
int for_lhs;
copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs)
{
rtx copy, temp;
int i, j;
@ -2050,7 +2006,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
{
if (!map->leaf_reg_map[regno][mode])
map->leaf_reg_map[regno][mode] = gen_rtx_REG (mode, regno);
return map->leaf_reg_map[regno][mode];
return map->leaf_reg_map[regno][mode];
}
#endif
else
@ -2280,7 +2236,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
MEM_COPY_ATTRIBUTES (copy, XEXP (orig, 0));
return
gen_rtx_CALL (GET_MODE (orig), copy,
gen_rtx_CALL (GET_MODE (orig), copy,
copy_rtx_and_substitute (XEXP (orig, 1), map, 0));
}
break;
@ -2447,9 +2403,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
/* Substitute known constant values into INSN, if that is valid. */
void
try_constants (insn, map)
rtx insn;
struct inline_remap *map;
try_constants (rtx insn, struct inline_remap *map)
{
int i;
@ -2463,7 +2417,7 @@ try_constants (insn, map)
apply_change_group ();
subst_constants (&PATTERN (insn), insn, map, 0);
apply_change_group ();
/* Enforce consistency between the addresses in the regular insn flow
and the ones in CALL_INSN_FUNCTION_USAGE lists, if any. */
if (GET_CODE (insn) == CALL_INSN && CALL_INSN_FUNCTION_USAGE (insn))
@ -2521,11 +2475,7 @@ try_constants (insn, map)
If MEMONLY is nonzero, only make changes inside a MEM. */
static void
subst_constants (loc, insn, map, memonly)
rtx *loc;
rtx insn;
struct inline_remap *map;
int memonly;
subst_constants (rtx *loc, rtx insn, struct inline_remap *map, int memonly)
{
rtx x = *loc;
int i, j;
@ -2599,7 +2549,7 @@ subst_constants (loc, insn, map, memonly)
integral mode and extracting the low part. */
subst_constants (&inner, NULL_RTX, map, 0);
new = simplify_gen_subreg (GET_MODE (x), inner,
GET_MODE (SUBREG_REG (x)),
GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x));
if (new)
@ -2856,10 +2806,7 @@ subst_constants (loc, insn, map, memonly)
called from note_stores with parts of the new insn. */
static void
mark_stores (dest, x, data)
rtx dest;
rtx x ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
mark_stores (rtx dest, rtx x ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED)
{
int regno = -1;
enum machine_mode mode = VOIDmode;
@ -2908,8 +2855,7 @@ mark_stores (dest, x, data)
values to point to themselves. */
static void
set_block_origin_self (stmt)
tree stmt;
set_block_origin_self (tree stmt)
{
if (BLOCK_ABSTRACT_ORIGIN (stmt) == NULL_TREE)
{
@ -2947,8 +2893,7 @@ set_block_origin_self (stmt)
point to themselves. */
void
set_decl_origin_self (decl)
tree decl;
set_decl_origin_self (tree decl)
{
if (DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE)
{
@ -2972,9 +2917,7 @@ set_decl_origin_self (decl)
(recursively) which are contained therein. */
static void
set_block_abstract_flags (stmt, setting)
tree stmt;
int setting;
set_block_abstract_flags (tree stmt, int setting)
{
tree local_decl;
tree subblock;
@ -2999,9 +2942,7 @@ set_block_abstract_flags (stmt, setting)
blocks and sub-blocks (recursively) to the same setting. */
void
set_decl_abstract_flags (decl, setting)
tree decl;
int setting;
set_decl_abstract_flags (tree decl, int setting)
{
DECL_ABSTRACT (decl) = setting;
if (TREE_CODE (decl) == FUNCTION_DECL)
@ -3023,8 +2964,7 @@ set_decl_abstract_flags (decl, setting)
static GTY(()) struct function *old_cfun;
void
output_inline_function (fndecl)
tree fndecl;
output_inline_function (tree fndecl)
{
enum debug_info_type old_write_symbols = write_symbols;
const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks;
@ -3067,9 +3007,7 @@ output_inline_function (fndecl)
the function. */
rtx
get_hard_reg_initial_reg (fun, reg)
struct function *fun;
rtx reg;
get_hard_reg_initial_reg (struct function *fun, rtx reg)
{
struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
int i;
@ -3085,9 +3023,7 @@ get_hard_reg_initial_reg (fun, reg)
}
rtx
has_func_hard_reg_initial_val (fun, reg)
struct function *fun;
rtx reg;
has_func_hard_reg_initial_val (struct function *fun, rtx reg)
{
struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
int i;
@ -3103,9 +3039,7 @@ has_func_hard_reg_initial_val (fun, reg)
}
rtx
get_func_hard_reg_initial_val (fun, reg)
struct function *fun;
rtx reg;
get_func_hard_reg_initial_val (struct function *fun, rtx reg)
{
struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
rtx rv = has_func_hard_reg_initial_val (fun, reg);
@ -3125,7 +3059,7 @@ get_func_hard_reg_initial_val (fun, reg)
if (ivs->num_entries >= ivs->max_entries)
{
ivs->max_entries += 5;
ivs->entries =
ivs->entries =
(initial_value_pair *) ggc_realloc (ivs->entries,
ivs->max_entries
* sizeof (initial_value_pair));
@ -3138,25 +3072,19 @@ get_func_hard_reg_initial_val (fun, reg)
}
rtx
get_hard_reg_initial_val (mode, regno)
enum machine_mode mode;
int regno;
get_hard_reg_initial_val (enum machine_mode mode, int regno)
{
return get_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno));
}
rtx
has_hard_reg_initial_val (mode, regno)
enum machine_mode mode;
int regno;
has_hard_reg_initial_val (enum machine_mode mode, int regno)
{
return has_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno));
}
static void
setup_initial_hard_reg_value_integration (inl_f, remap)
struct function *inl_f;
struct inline_remap *remap;
setup_initial_hard_reg_value_integration (struct function *inl_f, struct inline_remap *remap)
{
struct initial_value_struct *ivs = inl_f->hard_reg_initial_vals;
int i;
@ -3171,7 +3099,7 @@ setup_initial_hard_reg_value_integration (inl_f, remap)
void
emit_initial_value_sets ()
emit_initial_value_sets (void)
{
struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;
int i;
@ -3192,8 +3120,7 @@ emit_initial_value_sets ()
/* If the backend knows where to allocate pseudos for hard
register initial values, register these allocations now. */
void
allocate_initial_values (reg_equiv_memory_loc)
rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED;
allocate_initial_values (rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED)
{
#ifdef ALLOCATE_INITIAL_VALUE
struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;

View File

@ -1,5 +1,6 @@
/* Function integration definitions for GCC
Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -112,7 +113,7 @@ struct inline_remap
rtx dest;
rtx equiv;
} equiv_sets[MAX_RECOG_OPERANDS];
/* Record the last thing assigned to pc. This is used for folded
/* Record the last thing assigned to pc. This is used for folded
conditional branch insns. */
rtx last_pc_value;
#ifdef HAVE_cc0
@ -127,41 +128,41 @@ struct inline_remap
/* Return a copy of an rtx (as needed), substituting pseudo-register,
labels, and frame-pointer offsets as necessary. */
extern rtx copy_rtx_and_substitute PARAMS ((rtx, struct inline_remap *, int));
extern rtx copy_rtx_and_substitute (rtx, struct inline_remap *, int);
/* Return a pseudo that corresponds to the value in the specified hard
reg as of the start of the function (for inlined functions, the
value at the start of the parent function). */
extern rtx get_hard_reg_initial_val PARAMS ((enum machine_mode, int));
extern rtx get_hard_reg_initial_val (enum machine_mode, int);
/* Likewise, but for a different than the current function, or
arbitrary expression. */
extern rtx get_func_hard_reg_initial_val PARAMS ((struct function *, rtx));
extern rtx get_func_hard_reg_initial_val (struct function *, rtx);
/* Likewise, but iff someone else has caused it to become allocated. */
extern rtx has_func_hard_reg_initial_val PARAMS ((struct function *, rtx));
extern rtx has_func_hard_reg_initial_val (struct function *, rtx);
/* Likewise, but for common cases. */
extern rtx has_hard_reg_initial_val PARAMS ((enum machine_mode, int));
extern rtx has_hard_reg_initial_val (enum machine_mode, int);
/* If a pseudo represents an initial hard reg (or expression), return
it, else return NULL_RTX. */
extern rtx get_hard_reg_initial_reg PARAMS ((struct function *, rtx));
extern rtx get_hard_reg_initial_reg (struct function *, rtx);
/* Called from rest_of_compilation. */
extern void emit_initial_value_sets PARAMS ((void));
extern void allocate_initial_values PARAMS ((rtx *));
extern void emit_initial_value_sets (void);
extern void allocate_initial_values (rtx *);
/* Copy a declaration when one function is substituted inline into
another. */
extern union tree_node *copy_decl_for_inlining PARAMS ((union tree_node *,
union tree_node *,
union tree_node *));
extern union tree_node *copy_decl_for_inlining (union tree_node *,
union tree_node *,
union tree_node *);
/* Check whether there's any attribute in a function declaration that
makes the function uninlinable. Returns false if it finds any,
true otherwise. */
extern bool function_attribute_inlinable_p PARAMS ((union tree_node *));
extern bool function_attribute_inlinable_p (union tree_node *);
extern void try_constants PARAMS ((rtx, struct inline_remap *));
extern void try_constants (rtx, struct inline_remap *);
/* Return the label indicated. */
extern rtx get_label_from_map PARAMS ((struct inline_remap *, int));
extern rtx get_label_from_map (struct inline_remap *, int);
/* Set the label indicated. */
#define set_label_in_map(MAP, I, X) ((MAP)->label_map[I] = (X))