Commit 1d088dee by Andreas Jaeger Committed by Andreas Jaeger

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
parent 48166869
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> 2003-07-05 Kazu Hirata <kazu@cs.umass.edu>
* combine.c (nonzero_bits1): Fix a warning. * combine.c (nonzero_bits1): Fix a warning.
......
...@@ -88,7 +88,7 @@ compilation is specified by a string called a "spec". */ ...@@ -88,7 +88,7 @@ compilation is specified by a string called a "spec". */
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
#if defined (HAVE_DECL_GETRUSAGE) && !HAVE_DECL_GETRUSAGE #if defined (HAVE_DECL_GETRUSAGE) && !HAVE_DECL_GETRUSAGE
extern int getrusage PARAMS ((int, struct rusage *)); extern int getrusage (int, struct rusage *);
#endif #endif
/* By default there is no special suffix for target executables. */ /* By default there is no special suffix for target executables. */
...@@ -286,82 +286,74 @@ static struct rusage rus, prus; ...@@ -286,82 +286,74 @@ static struct rusage rus, prus;
/* Forward declaration for prototypes. */ /* Forward declaration for prototypes. */
struct path_prefix; struct path_prefix;
static void init_spec PARAMS ((void)); static void init_spec (void);
static void store_arg PARAMS ((const char *, int, int)); static void store_arg (const char *, int, int);
static char *load_specs PARAMS ((const char *)); static char *load_specs (const char *);
static void read_specs PARAMS ((const char *, int)); static void read_specs (const char *, int);
static void set_spec PARAMS ((const char *, const char *)); static void set_spec (const char *, const char *);
static struct compiler *lookup_compiler PARAMS ((const char *, size_t, const char *)); static struct compiler *lookup_compiler (const char *, size_t, const char *);
static char *build_search_list PARAMS ((struct path_prefix *, const char *, int)); static char *build_search_list (struct path_prefix *, const char *, int);
static void putenv_from_prefixes PARAMS ((struct path_prefix *, const char *)); static void putenv_from_prefixes (struct path_prefix *, const char *);
static int access_check PARAMS ((const char *, int)); static int access_check (const char *, int);
static char *find_a_file PARAMS ((struct path_prefix *, const char *, static char *find_a_file (struct path_prefix *, const char *, int, int);
int, int)); static void add_prefix (struct path_prefix *, const char *, const char *,
static void add_prefix PARAMS ((struct path_prefix *, const char *, int, int, int *, int);
const char *, int, int, int *, int)); static void add_sysrooted_prefix (struct path_prefix *, const char *,
static void add_sysrooted_prefix PARAMS ((struct path_prefix *, const char *, const char *, int, int, int *, int);
const char *, int, int, int *, int)); static void translate_options (int *, const char *const **);
static void translate_options PARAMS ((int *, const char *const **)); static char *skip_whitespace (char *);
static char *skip_whitespace PARAMS ((char *)); static void delete_if_ordinary (const char *);
static void delete_if_ordinary PARAMS ((const char *)); static void delete_temp_files (void);
static void delete_temp_files PARAMS ((void)); static void delete_failure_queue (void);
static void delete_failure_queue PARAMS ((void)); static void clear_failure_queue (void);
static void clear_failure_queue PARAMS ((void)); static int check_live_switch (int, int);
static int check_live_switch PARAMS ((int, int)); static const char *handle_braces (const char *);
static const char *handle_braces PARAMS ((const char *)); static inline bool input_suffix_matches (const char *, const char *);
static inline bool input_suffix_matches PARAMS ((const char *, static inline bool switch_matches (const char *, const char *, int);
const char *)); static inline void mark_matching_switches (const char *, const char *, int);
static inline bool switch_matches PARAMS ((const char *, static inline void process_marked_switches (void);
const char *, int)); static const char *process_brace_body (const char *, const char *, const char *, int, int);
static inline void mark_matching_switches PARAMS ((const char *, static const struct spec_function *lookup_spec_function (const char *);
const char *, int)); static const char *eval_spec_function (const char *, const char *);
static inline void process_marked_switches PARAMS ((void)); static const char *handle_spec_function (const char *);
static const char *process_brace_body PARAMS ((const char *, const char *, static char *save_string (const char *, int);
const char *, int, int)); static void set_collect_gcc_options (void);
static const struct spec_function *lookup_spec_function PARAMS ((const char *)); static int do_spec_1 (const char *, int, const char *);
static const char *eval_spec_function PARAMS ((const char *, const char *)); static int do_spec_2 (const char *);
static const char *handle_spec_function PARAMS ((const char *)); static void do_option_spec (const char *, const char *);
static char *save_string PARAMS ((const char *, int)); static void do_self_spec (const char *);
static void set_collect_gcc_options PARAMS ((void)); static const char *find_file (const char *);
static int do_spec_1 PARAMS ((const char *, int, const char *)); static int is_directory (const char *, const char *, int);
static int do_spec_2 PARAMS ((const char *)); static const char *validate_switches (const char *);
static void do_option_spec PARAMS ((const char *, const char *)); static void validate_all_switches (void);
static void do_self_spec PARAMS ((const char *)); static inline void validate_switches_from_spec (const char *);
static const char *find_file PARAMS ((const char *)); static void give_switch (int, int);
static int is_directory PARAMS ((const char *, const char *, int)); static int used_arg (const char *, int);
static const char *validate_switches PARAMS ((const char *)); static int default_arg (const char *, int);
static void validate_all_switches PARAMS ((void)); static void set_multilib_dir (void);
static inline void validate_switches_from_spec PARAMS ((const char *)); static void print_multilib_info (void);
static void give_switch PARAMS ((int, int)); static void perror_with_name (const char *);
static int used_arg PARAMS ((const char *, int)); static void pfatal_pexecute (const char *, const char *) ATTRIBUTE_NORETURN;
static int default_arg PARAMS ((const char *, int)); static void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
static void set_multilib_dir PARAMS ((void)); static void display_help (void);
static void print_multilib_info PARAMS ((void)); static void add_preprocessor_option (const char *, int);
static void perror_with_name PARAMS ((const char *)); static void add_assembler_option (const char *, int);
static void pfatal_pexecute PARAMS ((const char *, const char *)) static void add_linker_option (const char *, int);
ATTRIBUTE_NORETURN; static void process_command (int, const char *const *);
static void notice PARAMS ((const char *, ...)) static int execute (void);
ATTRIBUTE_PRINTF_1; static void alloc_args (void);
static void display_help PARAMS ((void)); static void clear_args (void);
static void add_preprocessor_option PARAMS ((const char *, int)); static void fatal_error (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));
#ifdef ENABLE_SHARED_LIBGCC #ifdef ENABLE_SHARED_LIBGCC
static void init_gcc_specs PARAMS ((struct obstack *, static void init_gcc_specs (struct obstack *, const char *, const char *,
const char *, const char *, const char *);
const char *));
#endif #endif
#if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX) #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 #endif
static const char *if_exists_spec_function PARAMS ((int, const char **)); static const char *if_exists_spec_function (int, const char **);
static const char *if_exists_else_spec_function PARAMS ((int, const char **)); static const char *if_exists_else_spec_function (int, const char **);
/* The Specs Language /* The Specs Language
...@@ -503,9 +495,9 @@ or with constant text in a single argument. ...@@ -503,9 +495,9 @@ or with constant text in a single argument.
name starts with `o'. %{o*} would substitute this text, name starts with `o'. %{o*} would substitute this text,
including the space; thus, two arguments would be generated. including the space; thus, two arguments would be generated.
%{S*&T*} likewise, but preserve order of S and T options (the order %{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 S and T in the spec is not significant). Can be any number
of ampersand-separated variables; for each the wild card is of ampersand-separated variables; for each the wild card is
optional. Useful for CPP as %{D*&U*&A*}. 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 given to CC.
%{!S:X} substitutes X, if the -S switch was NOT 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[] = ...@@ -958,7 +950,7 @@ static const struct compiler default_compilers[] =
as %(asm_debug) %(asm_options) %m.s %A }}}}" as %(asm_debug) %(asm_options) %m.s %A }}}}"
#endif #endif
, 0}, , 0},
#include "specs.h" #include "specs.h"
/* Mark end of table. */ /* Mark end of table. */
{0, 0, 0} {0, 0, 0}
...@@ -1109,9 +1101,7 @@ static const struct { ...@@ -1109,9 +1101,7 @@ static const struct {
and store its length in *ARGVC. */ and store its length in *ARGVC. */
static void static void
translate_options (argcp, argvp) translate_options (int *argcp, const char *const **argvp)
int *argcp;
const char *const **argvp;
{ {
int i; int i;
int argc = *argcp; int argc = *argcp;
...@@ -1321,8 +1311,7 @@ translate_options (argcp, argvp) ...@@ -1321,8 +1311,7 @@ translate_options (argcp, argvp)
} }
static char * static char *
skip_whitespace (p) skip_whitespace (char *p)
char *p;
{ {
while (1) while (1)
{ {
...@@ -1546,11 +1535,8 @@ static int processing_spec_function; ...@@ -1546,11 +1535,8 @@ static int processing_spec_function;
#ifdef ENABLE_SHARED_LIBGCC #ifdef ENABLE_SHARED_LIBGCC
static void static void
init_gcc_specs (obstack, shared_name, static_name, eh_name) init_gcc_specs (struct obstack *obstack, const char *shared_name,
struct obstack *obstack; const char *static_name, const char *eh_name)
const char *shared_name;
const char *static_name;
const char *eh_name;
{ {
char *buf; char *buf;
...@@ -1719,9 +1705,7 @@ init_spec () ...@@ -1719,9 +1705,7 @@ init_spec ()
current spec. */ current spec. */
static void static void
set_spec (name, spec) set_spec (const char *name, const char *spec)
const char *name;
const char *spec;
{ {
struct spec_list *sl; struct spec_list *sl;
const char *old_spec; const char *old_spec;
...@@ -1827,7 +1811,7 @@ alloc_args () ...@@ -1827,7 +1811,7 @@ alloc_args ()
/* Clear out the vector of arguments (after a command is executed). */ /* Clear out the vector of arguments (after a command is executed). */
static void static void
clear_args () clear_args (void)
{ {
argbuf_index = 0; argbuf_index = 0;
} }
...@@ -1840,9 +1824,7 @@ clear_args () ...@@ -1840,9 +1824,7 @@ clear_args ()
and the file should be deleted if this compilation fails. */ and the file should be deleted if this compilation fails. */
static void static void
store_arg (arg, delete_always, delete_failure) store_arg (const char *arg, int delete_always, int delete_failure)
const char *arg;
int delete_always, delete_failure;
{ {
if (argbuf_index + 1 == argbuf_length) if (argbuf_index + 1 == argbuf_length)
argbuf argbuf
...@@ -1861,8 +1843,7 @@ store_arg (arg, delete_always, delete_failure) ...@@ -1861,8 +1843,7 @@ store_arg (arg, delete_always, delete_failure)
a single \n. */ a single \n. */
static char * static char *
load_specs (filename) load_specs (const char *filename)
const char *filename;
{ {
int desc; int desc;
int readlen; int readlen;
...@@ -1926,9 +1907,7 @@ load_specs (filename) ...@@ -1926,9 +1907,7 @@ load_specs (filename)
Anything invalid in the file is a fatal error. */ Anything invalid in the file is a fatal error. */
static void static void
read_specs (filename, main_p) read_specs (const char *filename, int main_p)
const char *filename;
int main_p;
{ {
char *buffer; char *buffer;
char *p; char *p;
...@@ -2198,10 +2177,7 @@ static struct temp_file *failure_delete_queue; ...@@ -2198,10 +2177,7 @@ static struct temp_file *failure_delete_queue;
otherwise delete it in any case. */ otherwise delete it in any case. */
void void
record_temp_file (filename, always_delete, fail_delete) record_temp_file (const char *filename, int always_delete, int fail_delete)
const char *filename;
int always_delete;
int fail_delete;
{ {
char *const name = xstrdup (filename); char *const name = xstrdup (filename);
...@@ -2239,8 +2215,7 @@ record_temp_file (filename, always_delete, fail_delete) ...@@ -2239,8 +2215,7 @@ record_temp_file (filename, always_delete, fail_delete)
/* Delete all the temporary files whose names we previously recorded. */ /* Delete all the temporary files whose names we previously recorded. */
static void static void
delete_if_ordinary (name) delete_if_ordinary (const char *name)
const char *name;
{ {
struct stat st; struct stat st;
#ifdef DEBUG #ifdef DEBUG
...@@ -2262,7 +2237,7 @@ delete_if_ordinary (name) ...@@ -2262,7 +2237,7 @@ delete_if_ordinary (name)
} }
static void static void
delete_temp_files () delete_temp_files (void)
{ {
struct temp_file *temp; struct temp_file *temp;
...@@ -2274,7 +2249,7 @@ delete_temp_files () ...@@ -2274,7 +2249,7 @@ delete_temp_files ()
/* Delete all the files to be deleted on error. */ /* Delete all the files to be deleted on error. */
static void static void
delete_failure_queue () delete_failure_queue (void)
{ {
struct temp_file *temp; struct temp_file *temp;
...@@ -2283,7 +2258,7 @@ delete_failure_queue () ...@@ -2283,7 +2258,7 @@ delete_failure_queue ()
} }
static void static void
clear_failure_queue () clear_failure_queue (void)
{ {
failure_delete_queue = 0; failure_delete_queue = 0;
} }
...@@ -2295,10 +2270,8 @@ clear_failure_queue () ...@@ -2295,10 +2270,8 @@ clear_failure_queue ()
It is also used by the --print-search-dirs flag. */ It is also used by the --print-search-dirs flag. */
static char * static char *
build_search_list (paths, prefix, check_dir_p) build_search_list (struct path_prefix *paths, const char *prefix,
struct path_prefix *paths; int check_dir_p)
const char *prefix;
int check_dir_p;
{ {
int suffix_len = (machine_suffix) ? strlen (machine_suffix) : 0; int suffix_len = (machine_suffix) ? strlen (machine_suffix) : 0;
int just_suffix_len int just_suffix_len
...@@ -2357,9 +2330,7 @@ build_search_list (paths, prefix, check_dir_p) ...@@ -2357,9 +2330,7 @@ build_search_list (paths, prefix, check_dir_p)
for collect. */ for collect. */
static void static void
putenv_from_prefixes (paths, env_var) putenv_from_prefixes (struct path_prefix *paths, const char *env_var)
struct path_prefix *paths;
const char *env_var;
{ {
putenv (build_search_list (paths, env_var, 1)); putenv (build_search_list (paths, env_var, 1));
} }
...@@ -2368,9 +2339,7 @@ putenv_from_prefixes (paths, env_var) ...@@ -2368,9 +2339,7 @@ putenv_from_prefixes (paths, env_var)
except that it never considers directories to be executable. */ except that it never considers directories to be executable. */
static int static int
access_check (name, mode) access_check (const char *name, int mode)
const char *name;
int mode;
{ {
if (mode == X_OK) if (mode == X_OK)
{ {
...@@ -2389,10 +2358,8 @@ access_check (name, mode) ...@@ -2389,10 +2358,8 @@ access_check (name, mode)
Return 0 if not found, otherwise return its name, allocated with malloc. */ Return 0 if not found, otherwise return its name, allocated with malloc. */
static char * static char *
find_a_file (pprefix, name, mode, multilib) find_a_file (struct path_prefix *pprefix, const char *name, int mode,
struct path_prefix *pprefix; int multilib)
const char *name;
int mode, multilib;
{ {
char *temp; char *temp;
const char *const file_suffix = const char *const file_suffix =
...@@ -2567,15 +2534,9 @@ enum path_prefix_priority ...@@ -2567,15 +2534,9 @@ enum path_prefix_priority
2 means try both machine_suffix and just_machine_suffix. */ 2 means try both machine_suffix and just_machine_suffix. */
static void static void
add_prefix (pprefix, prefix, component, priority, require_machine_suffix, add_prefix (struct path_prefix *pprefix, const char *prefix,
warn, os_multilib) const char *component, /* enum prefix_priority */ int priority,
struct path_prefix *pprefix; int require_machine_suffix, int *warn, int os_multilib)
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; struct prefix_list *pl, **prev;
int len; int len;
...@@ -2608,15 +2569,10 @@ add_prefix (pprefix, prefix, component, priority, require_machine_suffix, ...@@ -2608,15 +2569,10 @@ add_prefix (pprefix, prefix, component, priority, require_machine_suffix,
/* Same as add_prefix, but prepending target_system_root to prefix. */ /* Same as add_prefix, but prepending target_system_root to prefix. */
static void static void
add_sysrooted_prefix (pprefix, prefix, component, priority, add_sysrooted_prefix (struct path_prefix *pprefix, const char *prefix,
require_machine_suffix, warn, os_multilib) const char *component,
struct path_prefix *pprefix; /* enum prefix_priority */ int priority,
const char *prefix; int require_machine_suffix, int *warn, int os_multilib)
const char *component;
/* enum prefix_priority */ int priority;
int require_machine_suffix;
int *warn;
int os_multilib;
{ {
if (!IS_ABSOLUTE_PATH (prefix)) if (!IS_ABSOLUTE_PATH (prefix))
abort (); abort ();
...@@ -2643,7 +2599,7 @@ add_sysrooted_prefix (pprefix, prefix, component, priority, ...@@ -2643,7 +2599,7 @@ add_sysrooted_prefix (pprefix, prefix, component, priority,
Return 0 if successful, -1 if failed. */ Return 0 if successful, -1 if failed. */
static int static int
execute () execute (void)
{ {
int i; int i;
int n_commands; /* # of command. */ int n_commands; /* # of command. */
...@@ -2957,10 +2913,8 @@ static int *warn_std_ptr = 0; ...@@ -2957,10 +2913,8 @@ static int *warn_std_ptr = 0;
is true if we should look for an object suffix. */ is true if we should look for an object suffix. */
static const char * static const char *
convert_filename (name, do_exe, do_obj) convert_filename (const char *name, int do_exe ATTRIBUTE_UNUSED,
const char *name; int do_obj ATTRIBUTE_UNUSED)
int do_exe ATTRIBUTE_UNUSED;
int do_obj ATTRIBUTE_UNUSED;
{ {
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX) #if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
int i; int i;
...@@ -3010,7 +2964,7 @@ convert_filename (name, do_exe, do_obj) ...@@ -3010,7 +2964,7 @@ convert_filename (name, do_exe, do_obj)
/* Display the command line switches accepted by gcc. */ /* Display the command line switches accepted by gcc. */
static void static void
display_help () display_help (void)
{ {
printf (_("Usage: %s [options] file...\n"), programname); printf (_("Usage: %s [options] file...\n"), programname);
fputs (_("Options:\n"), stdout); fputs (_("Options:\n"), stdout);
...@@ -3070,9 +3024,7 @@ display_help () ...@@ -3070,9 +3024,7 @@ display_help ()
} }
static void static void
add_preprocessor_option (option, len) add_preprocessor_option (const char *option, int len)
const char *option;
int len;
{ {
n_preprocessor_options++; n_preprocessor_options++;
...@@ -3089,9 +3041,7 @@ add_preprocessor_option (option, len) ...@@ -3089,9 +3041,7 @@ add_preprocessor_option (option, len)
} }
static void static void
add_assembler_option (option, len) add_assembler_option (const char *option, int len)
const char *option;
int len;
{ {
n_assembler_options++; n_assembler_options++;
...@@ -3107,9 +3057,7 @@ add_assembler_option (option, len) ...@@ -3107,9 +3057,7 @@ add_assembler_option (option, len)
} }
static void static void
add_linker_option (option, len) add_linker_option (const char *option, int len)
const char *option;
int len;
{ {
n_linker_options++; n_linker_options++;
...@@ -3128,9 +3076,7 @@ add_linker_option (option, len) ...@@ -3128,9 +3076,7 @@ add_linker_option (option, len)
Store its length in `n_switches'. */ Store its length in `n_switches'. */
static void static void
process_command (argc, argv) process_command (int argc, const char *const *argv)
int argc;
const char *const *argv;
{ {
int i; int i;
const char *temp; const char *temp;
...@@ -3175,7 +3121,7 @@ process_command (argc, argv) ...@@ -3175,7 +3121,7 @@ process_command (argc, argv)
char **new_argv; char **new_argv;
char *new_argv0; char *new_argv0;
int baselen; int baselen;
while (argc > 1 && argv[1][0] == '-' while (argc > 1 && argv[1][0] == '-'
&& (argv[1][1] == 'V' || argv[1][1] == 'b')) && (argv[1][1] == 'V' || argv[1][1] == 'b'))
{ {
...@@ -3204,7 +3150,7 @@ process_command (argc, argv) ...@@ -3204,7 +3150,7 @@ process_command (argc, argv)
for (baselen = strlen (progname); baselen > 0; baselen--) for (baselen = strlen (progname); baselen > 0; baselen--)
if (IS_DIR_SEPARATOR (progname[baselen-1])) if (IS_DIR_SEPARATOR (progname[baselen-1]))
break; break;
new_argv0 = xmemdup (progname, baselen, new_argv0 = xmemdup (progname, baselen,
baselen + concat_length (new_version, new_machine, baselen + concat_length (new_version, new_machine,
"-gcc-", NULL) + 1); "-gcc-", NULL) + 1);
strcpy (new_argv0 + baselen, new_machine); strcpy (new_argv0 + baselen, new_machine);
...@@ -3784,7 +3730,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ...@@ -3784,7 +3730,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
use_pipes = 0; use_pipes = 0;
} }
/* Set up the search paths before we go looking for config files. */ /* 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 /* 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" ...@@ -4120,7 +4066,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
and place that in the environment. */ and place that in the environment. */
static void static void
set_collect_gcc_options () set_collect_gcc_options (void)
{ {
int i; int i;
int first_time; int first_time;
...@@ -4225,8 +4171,7 @@ static const char *suffix_subst; ...@@ -4225,8 +4171,7 @@ static const char *suffix_subst;
Returns 0 if the spec is successfully processed; -1 if failed. */ Returns 0 if the spec is successfully processed; -1 if failed. */
int int
do_spec (spec) do_spec (const char *spec)
const char *spec;
{ {
int value; int value;
...@@ -4249,8 +4194,7 @@ do_spec (spec) ...@@ -4249,8 +4194,7 @@ do_spec (spec)
} }
static int static int
do_spec_2 (spec) do_spec_2 (const char *spec)
const char *spec;
{ {
const char *string; const char *string;
int result; int result;
...@@ -4286,9 +4230,7 @@ do_spec_2 (spec) ...@@ -4286,9 +4230,7 @@ do_spec_2 (spec)
of the switches/n_switches array. */ of the switches/n_switches array. */
static void static void
do_option_spec (name, spec) do_option_spec (const char *name, const char *spec)
const char *name;
const char *spec;
{ {
unsigned int i, value_count, value_len; unsigned int i, value_count, value_len;
const char *p, *q, *value; const char *p, *q, *value;
...@@ -4337,8 +4279,7 @@ do_option_spec (name, spec) ...@@ -4337,8 +4279,7 @@ do_option_spec (name, spec)
of the switches/n_switches array. */ of the switches/n_switches array. */
static void static void
do_self_spec (spec) do_self_spec (const char *spec)
const char *spec;
{ {
do_spec_2 (spec); do_spec_2 (spec);
do_spec_1 (" ", 0, NULL); do_spec_1 (" ", 0, NULL);
...@@ -4384,10 +4325,7 @@ do_self_spec (spec) ...@@ -4384,10 +4325,7 @@ do_self_spec (spec)
and the command on that line reported an error. */ and the command on that line reported an error. */
static int static int
do_spec_1 (spec, inswitch, soft_matched_part) do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
const char *spec;
int inswitch;
const char *soft_matched_part;
{ {
const char *p = spec; const char *p = spec;
int c; int c;
...@@ -4681,7 +4619,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4681,7 +4619,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
p++; p++;
if (p[0] == '%' && p[1] == 'O') if (p[0] == '%' && p[1] == 'O')
p += 2; p += 2;
break; break;
} }
goto create_temp_file; goto create_temp_file;
...@@ -4693,7 +4631,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4693,7 +4631,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
p++; p++;
if (p[0] == '%' && p[1] == 'O') if (p[0] == '%' && p[1] == 'O')
p += 2; p += 2;
break; break;
} }
goto create_temp_file; goto create_temp_file;
...@@ -4744,24 +4682,24 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4744,24 +4682,24 @@ do_spec_1 (spec, inswitch, soft_matched_part)
temp_filename = alloca (temp_filename_length + 1); temp_filename = alloca (temp_filename_length + 1);
strncpy ((char *) temp_filename, input_basename, basename_length); strncpy ((char *) temp_filename, input_basename, basename_length);
strncpy ((char *) temp_filename + basename_length, suffix, strncpy ((char *) temp_filename + basename_length, suffix,
suffix_length); suffix_length);
*((char *) temp_filename + temp_filename_length) = '\0'; *((char *) temp_filename + temp_filename_length) = '\0';
if (strcmp (temp_filename, input_filename) != 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. */ /* Note, set_input() resets input_stat_set to 0. */
if (input_stat_set == 0) if (input_stat_set == 0)
{ {
input_stat_set = stat (input_filename, &input_stat); input_stat_set = stat (input_filename, &input_stat);
if (input_stat_set >= 0) if (input_stat_set >= 0)
input_stat_set = 1; input_stat_set = 1;
} }
/* If we have the stat for the input_filename /* If we have the stat for the input_filename
and we can do the stat for the temp_filename and we can do the stat for the temp_filename
then the they could still refer to the same then the they could still refer to the same
file if st_dev/st_ino's are the same. */ file if st_dev/st_ino's are the same. */
if (input_stat_set != 1 if (input_stat_set != 1
|| stat (temp_filename, &st_temp) < 0 || stat (temp_filename, &st_temp) < 0
...@@ -4771,7 +4709,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4771,7 +4709,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
temp_filename = save_string (temp_filename, temp_filename = save_string (temp_filename,
temp_filename_length + 1); temp_filename_length + 1);
obstack_grow (&obstack, temp_filename, obstack_grow (&obstack, temp_filename,
temp_filename_length); temp_filename_length);
arg_going = 1; arg_going = 1;
delete_this_arg = 0; delete_this_arg = 0;
break; break;
...@@ -5058,11 +4996,11 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -5058,11 +4996,11 @@ do_spec_1 (spec, inswitch, soft_matched_part)
/* We assume there is a directory /* We assume there is a directory
separator at the end of this string. */ separator at the end of this string. */
if (target_system_root) if (target_system_root)
{ {
obstack_grow (&obstack, target_system_root, obstack_grow (&obstack, target_system_root,
strlen (target_system_root)); strlen (target_system_root));
if (target_sysroot_suffix) if (target_sysroot_suffix)
obstack_grow (&obstack, target_sysroot_suffix, obstack_grow (&obstack, target_sysroot_suffix,
strlen (target_sysroot_suffix)); strlen (target_sysroot_suffix));
} }
break; break;
...@@ -5264,8 +5202,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -5264,8 +5202,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
/* Look up a spec function. */ /* Look up a spec function. */
static const struct spec_function * static const struct spec_function *
lookup_spec_function (name) lookup_spec_function (const char *name)
const char *name;
{ {
static const struct spec_function * const spec_function_tables[] = static const struct spec_function * const spec_function_tables[] =
{ {
...@@ -5288,8 +5225,7 @@ lookup_spec_function (name) ...@@ -5288,8 +5225,7 @@ lookup_spec_function (name)
/* Evaluate a spec function. */ /* Evaluate a spec function. */
static const char * static const char *
eval_spec_function (func, args) eval_spec_function (const char *func, const char *args)
const char *func, *args;
{ {
const struct spec_function *sf; const struct spec_function *sf;
const char *funcval; const char *funcval;
...@@ -5361,8 +5297,7 @@ eval_spec_function (func, args) ...@@ -5361,8 +5297,7 @@ eval_spec_function (func, args)
NULL if no processing is required. */ NULL if no processing is required. */
static const char * static const char *
handle_spec_function (p) handle_spec_function (const char *p)
const char *p;
{ {
char *func, *args; char *func, *args;
const char *endp, *funcval; const char *endp, *funcval;
...@@ -5420,9 +5355,7 @@ handle_spec_function (p) ...@@ -5420,9 +5355,7 @@ handle_spec_function (p)
/* Inline subroutine of handle_braces. Returns true if the current /* Inline subroutine of handle_braces. Returns true if the current
input suffix matches the atom bracketed by ATOM and END_ATOM. */ input suffix matches the atom bracketed by ATOM and END_ATOM. */
static inline bool static inline bool
input_suffix_matches (atom, end_atom) input_suffix_matches (const char *atom, const char *end_atom)
const char *atom;
const char *end_atom;
{ {
return (input_suffix return (input_suffix
&& !strncmp (input_suffix, atom, end_atom - atom) && !strncmp (input_suffix, atom, end_atom - atom)
...@@ -5433,10 +5366,7 @@ input_suffix_matches (atom, end_atom) ...@@ -5433,10 +5366,7 @@ input_suffix_matches (atom, end_atom)
matching the atom bracketed by ATOM and END_ATOM appeared on the matching the atom bracketed by ATOM and END_ATOM appeared on the
command line. */ command line. */
static inline bool static inline bool
switch_matches (atom, end_atom, starred) switch_matches (const char *atom, const char *end_atom, int starred)
const char *atom;
const char *end_atom;
int starred;
{ {
int i; int i;
int len = end_atom - atom; int len = end_atom - atom;
...@@ -5455,10 +5385,7 @@ switch_matches (atom, end_atom, starred) ...@@ -5455,10 +5385,7 @@ switch_matches (atom, end_atom, starred)
match ATOM (extends to END_ATOM; STARRED indicates whether there match ATOM (extends to END_ATOM; STARRED indicates whether there
was a star after the atom) for later processing. */ was a star after the atom) for later processing. */
static inline void static inline void
mark_matching_switches (atom, end_atom, starred) mark_matching_switches (const char *atom, const char *end_atom, int starred)
const char *atom;
const char *end_atom;
int starred;
{ {
int i; int i;
int len = end_atom - atom; int len = end_atom - atom;
...@@ -5474,7 +5401,7 @@ mark_matching_switches (atom, end_atom, starred) ...@@ -5474,7 +5401,7 @@ mark_matching_switches (atom, end_atom, starred)
/* Inline subroutine of handle_braces. Process all the currently /* Inline subroutine of handle_braces. Process all the currently
marked switches through give_switch, and clear the marks. */ marked switches through give_switch, and clear the marks. */
static inline void static inline void
process_marked_switches () process_marked_switches (void)
{ {
int i; int i;
...@@ -5491,8 +5418,7 @@ process_marked_switches () ...@@ -5491,8 +5418,7 @@ process_marked_switches ()
if we call do_spec_1 and that returns -1. */ if we call do_spec_1 and that returns -1. */
static const char * static const char *
handle_braces (p) handle_braces (const char *p)
const char *p;
{ {
const char *atom, *end_atom; const char *atom, *end_atom;
const char *d_atom = NULL, *d_end_atom = NULL; const char *d_atom = NULL, *d_end_atom = NULL;
...@@ -5640,12 +5566,8 @@ handle_braces (p) ...@@ -5640,12 +5566,8 @@ handle_braces (p)
returns -1. */ returns -1. */
static const char * static const char *
process_brace_body (p, atom, end_atom, starred, matched) process_brace_body (const char *p, const char *atom, const char *end_atom,
const char *p; int starred, int matched)
const char *atom;
const char *end_atom;
int starred;
int matched;
{ {
const char *body, *end_body; const char *body, *end_body;
unsigned int nesting_level; unsigned int nesting_level;
...@@ -5672,7 +5594,7 @@ process_brace_body (p, atom, end_atom, starred, matched) ...@@ -5672,7 +5594,7 @@ process_brace_body (p, atom, end_atom, starred, matched)
abort (); abort ();
p++; p++;
} }
end_body = p; end_body = p;
while (end_body[-1] == ' ' || end_body[-1] == '\t') while (end_body[-1] == ' ' || end_body[-1] == '\t')
end_body--; end_body--;
...@@ -5725,9 +5647,7 @@ process_brace_body (p, atom, end_atom, starred, matched) ...@@ -5725,9 +5647,7 @@ process_brace_body (p, atom, end_atom, starred, matched)
with the "no-", similarly for a switch with the "no-" prefix. */ with the "no-", similarly for a switch with the "no-" prefix. */
static int static int
check_live_switch (switchnum, prefix_length) check_live_switch (int switchnum, int prefix_length)
int switchnum;
int prefix_length;
{ {
const char *name = switches[switchnum].part1; const char *name = switches[switchnum].part1;
int i; int i;
...@@ -5801,9 +5721,7 @@ check_live_switch (switchnum, prefix_length) ...@@ -5801,9 +5721,7 @@ check_live_switch (switchnum, prefix_length)
If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument. */ If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument. */
static void static void
give_switch (switchnum, omit_first_word) give_switch (int switchnum, int omit_first_word)
int switchnum;
int omit_first_word;
{ {
if (switches[switchnum].live_cond == SWITCH_IGNORE) if (switches[switchnum].live_cond == SWITCH_IGNORE)
return; return;
...@@ -5853,8 +5771,7 @@ give_switch (switchnum, omit_first_word) ...@@ -5853,8 +5771,7 @@ give_switch (switchnum, omit_first_word)
Return the absolute file name found. If nothing is found, return NAME. */ Return the absolute file name found. If nothing is found, return NAME. */
static const char * static const char *
find_file (name) find_file (const char *name)
const char *name;
{ {
char *newname; char *newname;
...@@ -5879,10 +5796,7 @@ find_file (name) ...@@ -5879,10 +5796,7 @@ find_file (name)
limit. */ limit. */
static int static int
is_directory (path1, path2, linker) is_directory (const char *path1, const char *path2, int linker)
const char *path1;
const char *path2;
int linker;
{ {
int len1 = strlen (path1); int len1 = strlen (path1);
int len2 = strlen (path2); int len2 = strlen (path2);
...@@ -5924,8 +5838,7 @@ is_directory (path1, path2, linker) ...@@ -5924,8 +5838,7 @@ is_directory (path1, path2, linker)
the input file named FILENAME. */ the input file named FILENAME. */
void void
set_input (filename) set_input (const char *filename)
const char *filename;
{ {
const char *p; const char *p;
...@@ -5966,8 +5879,7 @@ set_input (filename) ...@@ -5966,8 +5879,7 @@ set_input (filename)
/* On fatal signals, delete all the temporary files. */ /* On fatal signals, delete all the temporary files. */
static void static void
fatal_error (signum) fatal_error (int signum)
int signum;
{ {
signal (signum, SIG_DFL); signal (signum, SIG_DFL);
delete_failure_queue (); delete_failure_queue ();
...@@ -5977,12 +5889,10 @@ fatal_error (signum) ...@@ -5977,12 +5889,10 @@ fatal_error (signum)
kill (getpid (), signum); kill (getpid (), signum);
} }
extern int main PARAMS ((int, const char *const *)); extern int main (int, const char *const *);
int int
main (argc, argv) main (int argc, const char *const *argv)
int argc;
const char *const *argv;
{ {
size_t i; size_t i;
int value; int value;
...@@ -6512,10 +6422,7 @@ main (argc, argv) ...@@ -6512,10 +6422,7 @@ main (argc, argv)
or 0 if this file is to be passed to the linker. */ or 0 if this file is to be passed to the linker. */
static struct compiler * static struct compiler *
lookup_compiler (name, length, language) lookup_compiler (const char *name, size_t length, const char *language)
const char *name;
size_t length;
const char *language;
{ {
struct compiler *cp; struct compiler *cp;
...@@ -6581,9 +6488,7 @@ lookup_compiler (name, length, language) ...@@ -6581,9 +6488,7 @@ lookup_compiler (name, length, language)
} }
static char * static char *
save_string (s, len) save_string (const char *s, int len)
const char *s;
int len;
{ {
char *result = xmalloc (len + 1); char *result = xmalloc (len + 1);
...@@ -6593,8 +6498,7 @@ save_string (s, len) ...@@ -6593,8 +6498,7 @@ save_string (s, len)
} }
void void
pfatal_with_name (name) pfatal_with_name (const char *name)
const char *name;
{ {
perror_with_name (name); perror_with_name (name);
delete_temp_files (); delete_temp_files ();
...@@ -6602,16 +6506,13 @@ pfatal_with_name (name) ...@@ -6602,16 +6506,13 @@ pfatal_with_name (name)
} }
static void static void
perror_with_name (name) perror_with_name (const char *name)
const char *name;
{ {
error ("%s: %s", name, xstrerror (errno)); error ("%s: %s", name, xstrerror (errno));
} }
static void static void
pfatal_pexecute (errmsg_fmt, errmsg_arg) pfatal_pexecute (const char *errmsg_fmt, const char *errmsg_arg)
const char *errmsg_fmt;
const char *errmsg_arg;
{ {
if (errmsg_arg) if (errmsg_arg)
{ {
...@@ -6631,7 +6532,7 @@ pfatal_pexecute (errmsg_fmt, errmsg_arg) ...@@ -6631,7 +6532,7 @@ pfatal_pexecute (errmsg_fmt, errmsg_arg)
/* Output an error message and exit. */ /* Output an error message and exit. */
void void
fancy_abort () fancy_abort (void)
{ {
fatal ("internal gcc abort"); fatal ("internal gcc abort");
} }
...@@ -6642,7 +6543,7 @@ void ...@@ -6642,7 +6543,7 @@ void
fatal (const char *msgid, ...) fatal (const char *msgid, ...)
{ {
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, msgid);
fprintf (stderr, "%s: ", programname); fprintf (stderr, "%s: ", programname);
...@@ -6657,7 +6558,7 @@ void ...@@ -6657,7 +6558,7 @@ void
error (const char *msgid, ...) error (const char *msgid, ...)
{ {
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, msgid);
fprintf (stderr, "%s: ", programname); fprintf (stderr, "%s: ", programname);
vfprintf (stderr, _(msgid), ap); vfprintf (stderr, _(msgid), ap);
...@@ -6670,15 +6571,14 @@ static void ...@@ -6670,15 +6571,14 @@ static void
notice (const char *msgid, ...) notice (const char *msgid, ...)
{ {
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, msgid);
vfprintf (stderr, _(msgid), ap); vfprintf (stderr, _(msgid), ap);
va_end (ap); va_end (ap);
} }
static inline void static inline void
validate_switches_from_spec (spec) validate_switches_from_spec (const char *spec)
const char *spec;
{ {
const char *p = spec; const char *p = spec;
char c; char c;
...@@ -6689,7 +6589,7 @@ validate_switches_from_spec (spec) ...@@ -6689,7 +6589,7 @@ validate_switches_from_spec (spec)
} }
static void static void
validate_all_switches () validate_all_switches (void)
{ {
struct compiler *comp; struct compiler *comp;
struct spec_list *spec; struct spec_list *spec;
...@@ -6708,8 +6608,7 @@ validate_all_switches () ...@@ -6708,8 +6608,7 @@ validate_all_switches ()
and mark as valid all supplied switches that match it. */ and mark as valid all supplied switches that match it. */
static const char * static const char *
validate_switches (start) validate_switches (const char *start)
const char *start;
{ {
const char *p = start; const char *p = start;
const char *atom; const char *atom;
...@@ -6717,9 +6616,9 @@ validate_switches (start) ...@@ -6717,9 +6616,9 @@ validate_switches (start)
int i; int i;
bool suffix = false; bool suffix = false;
bool starred = false; bool starred = false;
#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0) #define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
next_member: next_member:
SKIP_WHITE (); SKIP_WHITE ();
...@@ -6792,9 +6691,7 @@ static int n_mdswitches; ...@@ -6792,9 +6691,7 @@ static int n_mdswitches;
canonicalize the switches to keep only the ones we care about. */ canonicalize the switches to keep only the ones we care about. */
static int static int
used_arg (p, len) used_arg (const char *p, int len)
const char *p;
int len;
{ {
struct mswitchstr struct mswitchstr
{ {
...@@ -6932,9 +6829,7 @@ used_arg (p, len) ...@@ -6932,9 +6829,7 @@ used_arg (p, len)
} }
static int static int
default_arg (p, len) default_arg (const char *p, int len)
const char *p;
int len;
{ {
int i; int i;
...@@ -6957,7 +6852,7 @@ default_arg (p, len) ...@@ -6957,7 +6852,7 @@ default_arg (p, len)
will be used. */ will be used. */
static void static void
set_multilib_dir () set_multilib_dir (void)
{ {
const char *p; const char *p;
unsigned int this_path_len; unsigned int this_path_len;
...@@ -6993,7 +6888,7 @@ set_multilib_dir () ...@@ -6993,7 +6888,7 @@ set_multilib_dir ()
if (*start == '\0') if (*start == '\0')
break; break;
for (end = start + 1; for (end = start + 1;
*end != ' ' && *end != '\t' && *end != '\0'; end++) *end != ' ' && *end != '\t' && *end != '\0'; end++)
; ;
...@@ -7192,7 +7087,7 @@ set_multilib_dir () ...@@ -7192,7 +7087,7 @@ set_multilib_dir ()
the exclusions. */ the exclusions. */
static void static void
print_multilib_info () print_multilib_info (void)
{ {
const char *p = multilib_select; const char *p = multilib_select;
const char *last_path = 0, *this_path; const char *last_path = 0, *this_path;
...@@ -7440,9 +7335,7 @@ print_multilib_info () ...@@ -7440,9 +7335,7 @@ print_multilib_info ()
(whose name has been expanded with %s). */ (whose name has been expanded with %s). */
static const char * static const char *
if_exists_spec_function (argc, argv) if_exists_spec_function (int argc, const char **argv)
int argc;
const char **argv;
{ {
/* Must have only one argument. */ /* Must have only one argument. */
if (argc == 1 && IS_ABSOLUTE_PATH (argv[0]) && ! access (argv[0], R_OK)) if (argc == 1 && IS_ABSOLUTE_PATH (argv[0]) && ! access (argv[0], R_OK))
...@@ -7457,9 +7350,7 @@ if_exists_spec_function (argc, argv) ...@@ -7457,9 +7350,7 @@ if_exists_spec_function (argc, argv)
is returned if the first argument does not exist. */ is returned if the first argument does not exist. */
static const char * static const char *
if_exists_else_spec_function (argc, argv) if_exists_else_spec_function (int argc, const char **argv)
int argc;
const char **argv;
{ {
/* Must have exactly two arguments. */ /* Must have exactly two arguments. */
if (argc != 2) if (argc != 2)
......
...@@ -26,9 +26,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -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 /* The mapping of a spec function name to the C function that
implements it. */ implements it. */
struct spec_function struct spec_function
{ {
const char *name; const char *name;
const char *(*func) PARAMS ((int, const char **)); const char *(*func) (int, const char **);
}; };
/* This defines which switch letters take arguments. */ /* This defines which switch letters take arguments. */
...@@ -54,22 +54,21 @@ struct spec_function ...@@ -54,22 +54,21 @@ struct spec_function
/* These are exported by gcc.c. */ /* These are exported by gcc.c. */
extern int do_spec PARAMS ((const char *)); extern int do_spec (const char *);
extern void record_temp_file PARAMS ((const char *, int, int)); extern void record_temp_file (const char *, int, int);
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN; extern void fancy_abort (void) ATTRIBUTE_NORETURN;
extern void fatal PARAMS ((const char *, ...)) extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; extern void pfatal_with_name (const char *) ATTRIBUTE_NORETURN;
extern void pfatal_with_name PARAMS ((const char *)) ATTRIBUTE_NORETURN; extern void set_input (const char *);
extern void set_input PARAMS ((const char *));
/* Spec files linked with gcc.c must provide definitions for these. */ /* Spec files linked with gcc.c must provide definitions for these. */
/* Called before processing to change/add/remove arguments. */ /* 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. */ /* 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; extern int n_infiles;
......
/* Dump a gcov file, for debugging use. /* 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> Contributed by Nathan Sidwell <nathan@codesourcery.com>
Gcov is free software; you can redistribute it and/or modify Gcov is free software; you can redistribute it and/or modify
...@@ -27,17 +27,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -27,17 +27,17 @@ Boston, MA 02111-1307, USA. */
#include "gcov-io.h" #include "gcov-io.h"
#include "gcov-io.c" #include "gcov-io.c"
static void dump_file PARAMS ((const char *)); static void dump_file (const char *);
static void print_prefix PARAMS ((const char *, unsigned, gcov_position_t)); static void print_prefix (const char *, unsigned, gcov_position_t);
static void print_usage PARAMS ((void)); static void print_usage (void);
static void print_version PARAMS ((void)); static void print_version (void);
static void tag_function PARAMS ((const char *, unsigned, unsigned)); static void tag_function (const char *, unsigned, unsigned);
static void tag_blocks PARAMS ((const char *, unsigned, unsigned)); static void tag_blocks (const char *, unsigned, unsigned);
static void tag_arcs PARAMS ((const char *, unsigned, unsigned)); static void tag_arcs (const char *, unsigned, unsigned);
static void tag_lines PARAMS ((const char *, unsigned, unsigned)); static void tag_lines (const char *, unsigned, unsigned);
static void tag_counters PARAMS ((const char *, unsigned, unsigned)); static void tag_counters (const char *, unsigned, unsigned);
static void tag_summary PARAMS ((const char *, unsigned, unsigned)); static void tag_summary (const char *, unsigned, unsigned);
extern int main PARAMS ((int, char **)); extern int main (int, char **);
typedef struct tag_format typedef struct tag_format
{ {
...@@ -72,9 +72,8 @@ static const tag_format_t tag_table[] = ...@@ -72,9 +72,8 @@ static const tag_format_t tag_table[] =
{0, NULL, NULL} {0, NULL, NULL}
}; };
int main (argc, argv) int
int argc ATTRIBUTE_UNUSED; main (int argc ATTRIBUTE_UNUSED, char **argv)
char **argv;
{ {
int opt; int opt;
...@@ -98,14 +97,14 @@ int main (argc, argv) ...@@ -98,14 +97,14 @@ int main (argc, argv)
fprintf (stderr, "unknown flag `%c'\n", opt); fprintf (stderr, "unknown flag `%c'\n", opt);
} }
} }
while (argv[optind]) while (argv[optind])
dump_file (argv[optind++]); dump_file (argv[optind++]);
return 0; return 0;
} }
static void static void
print_usage () print_usage (void)
{ {
printf ("Usage: gcov-dump [OPTION] ... gcovfiles\n"); printf ("Usage: gcov-dump [OPTION] ... gcovfiles\n");
printf ("Print coverage file contents\n"); printf ("Print coverage file contents\n");
...@@ -116,7 +115,7 @@ print_usage () ...@@ -116,7 +115,7 @@ print_usage ()
} }
static void static void
print_version () print_version (void)
{ {
char v[4]; char v[4];
unsigned version = GCOV_VERSION; unsigned version = GCOV_VERSION;
...@@ -131,13 +130,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ...@@ -131,13 +130,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
} }
static void static void
print_prefix (filename, depth, position) print_prefix (const char *filename, unsigned depth, gcov_position_t position)
const char *filename;
unsigned depth;
gcov_position_t position;
{ {
static const char prefix[] = " "; static const char prefix[] = " ";
printf ("%s:", filename); printf ("%s:", filename);
if (flag_dump_positions) if (flag_dump_positions)
printf ("%lu:", (unsigned long) position); printf ("%lu:", (unsigned long) position);
...@@ -145,18 +141,17 @@ print_prefix (filename, depth, position) ...@@ -145,18 +141,17 @@ print_prefix (filename, depth, position)
} }
static void static void
dump_file (filename) dump_file (const char *filename)
const char *filename;
{ {
unsigned tags[4]; unsigned tags[4];
unsigned depth = 0; unsigned depth = 0;
if (!gcov_open (filename, 1)) if (!gcov_open (filename, 1))
{ {
fprintf (stderr, "%s:cannot open\n", filename); fprintf (stderr, "%s:cannot open\n", filename);
return; return;
} }
/* magic */ /* magic */
{ {
unsigned magic = gcov_read_unsigned (); unsigned magic = gcov_read_unsigned ();
...@@ -166,7 +161,7 @@ dump_file (filename) ...@@ -166,7 +161,7 @@ dump_file (filename)
unsigned expected = GCOV_VERSION; unsigned expected = GCOV_VERSION;
unsigned ix; unsigned ix;
int different = version != GCOV_VERSION; int different = version != GCOV_VERSION;
if (magic == GCOV_DATA_MAGIC) if (magic == GCOV_DATA_MAGIC)
type = "data"; type = "data";
else if (magic == GCOV_GRAPH_MAGIC) else if (magic == GCOV_GRAPH_MAGIC)
...@@ -183,7 +178,7 @@ dump_file (filename) ...@@ -183,7 +178,7 @@ dump_file (filename)
v[ix] = version; v[ix] = version;
m[ix] = magic; m[ix] = magic;
} }
printf ("%s:%s:magic `%.4s':version `%.4s'\n", filename, type, m, v); printf ("%s:%s:magic `%.4s':version `%.4s'\n", filename, type, m, v);
if (different) if (different)
printf ("%s:warning:current version is `%.4s'\n", filename, e); printf ("%s:warning:current version is `%.4s'\n", filename, e);
...@@ -229,17 +224,17 @@ dump_file (filename) ...@@ -229,17 +224,17 @@ dump_file (filename)
depth = tag_depth; depth = tag_depth;
tags[depth - 1] = tag; tags[depth - 1] = tag;
} }
print_prefix (filename, tag_depth, position); print_prefix (filename, tag_depth, position);
printf ("%08x:%4u:%s", tag, length, format->name); printf ("%08x:%4u:%s", tag, length, format->name);
if (format->proc) if (format->proc)
(*format->proc) (filename, tag, length); (*format->proc) (filename, tag, length);
printf ("\n"); printf ("\n");
if (flag_dump_contents && format->proc) if (flag_dump_contents && format->proc)
{ {
unsigned long actual_length = gcov_position () - base; unsigned long actual_length = gcov_position () - base;
if (actual_length > length) if (actual_length > length)
printf ("%s:record size mismatch %lu bytes overread\n", printf ("%s:record size mismatch %lu bytes overread\n",
filename, actual_length - length); filename, actual_length - length);
...@@ -262,20 +257,18 @@ dump_file (filename) ...@@ -262,20 +257,18 @@ dump_file (filename)
} }
static void static void
tag_function (filename, tag, length) tag_function (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
unsigned long pos = gcov_position (); unsigned long pos = gcov_position ();
printf (" ident=%u", gcov_read_unsigned ()); printf (" ident=%u", gcov_read_unsigned ());
printf (", checksum=0x%08x", gcov_read_unsigned ()); printf (", checksum=0x%08x", gcov_read_unsigned ());
if (gcov_position () - pos < length) if (gcov_position () - pos < length)
{ {
const char *name; const char *name;
name = gcov_read_string (); name = gcov_read_string ();
printf (", `%s'", name ? name : "NULL"); printf (", `%s'", name ? name : "NULL");
name = gcov_read_string (); name = gcov_read_string ();
...@@ -285,13 +278,11 @@ tag_function (filename, tag, length) ...@@ -285,13 +278,11 @@ tag_function (filename, tag, length)
} }
static void static void
tag_blocks (filename, tag, length) tag_blocks (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
unsigned n_blocks = length / 4; unsigned n_blocks = length / 4;
printf (" %u blocks", n_blocks); printf (" %u blocks", n_blocks);
if (flag_dump_contents) if (flag_dump_contents)
...@@ -312,10 +303,8 @@ tag_blocks (filename, tag, length) ...@@ -312,10 +303,8 @@ tag_blocks (filename, tag, length)
} }
static void static void
tag_arcs (filename, tag, length) tag_arcs (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
unsigned n_arcs = (length - 4) / 8; unsigned n_arcs = (length - 4) / 8;
...@@ -328,7 +317,7 @@ tag_arcs (filename, tag, length) ...@@ -328,7 +317,7 @@ tag_arcs (filename, tag, length)
for (ix = 0; ix != n_arcs; ix++) for (ix = 0; ix != n_arcs; ix++)
{ {
unsigned dst, flags; unsigned dst, flags;
if (!(ix & 3)) if (!(ix & 3))
{ {
printf ("\n"); printf ("\n");
...@@ -343,10 +332,8 @@ tag_arcs (filename, tag, length) ...@@ -343,10 +332,8 @@ tag_arcs (filename, tag, length)
} }
static void static void
tag_lines (filename, tag, length) tag_lines (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
if (flag_dump_contents) if (flag_dump_contents)
{ {
...@@ -358,7 +345,7 @@ tag_lines (filename, tag, length) ...@@ -358,7 +345,7 @@ tag_lines (filename, tag, length)
gcov_position_t position = gcov_position (); gcov_position_t position = gcov_position ();
const char *source = NULL; const char *source = NULL;
unsigned lineno = gcov_read_unsigned (); unsigned lineno = gcov_read_unsigned ();
if (!lineno) if (!lineno)
{ {
source = gcov_read_string (); source = gcov_read_string ();
...@@ -366,7 +353,7 @@ tag_lines (filename, tag, length) ...@@ -366,7 +353,7 @@ tag_lines (filename, tag, length)
break; break;
sep = NULL; sep = NULL;
} }
if (!sep) if (!sep)
{ {
printf ("\n"); printf ("\n");
...@@ -389,14 +376,12 @@ tag_lines (filename, tag, length) ...@@ -389,14 +376,12 @@ tag_lines (filename, tag, length)
} }
static void static void
tag_counters (filename, tag, length) tag_counters (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
static const char *const counter_names[] = GCOV_COUNTER_NAMES; static const char *const counter_names[] = GCOV_COUNTER_NAMES;
unsigned n_counts = length / 8; unsigned n_counts = length / 8;
printf (" %s %u counts", printf (" %s %u counts",
counter_names[GCOV_COUNTER_FOR_TAG (tag)], n_counts); counter_names[GCOV_COUNTER_FOR_TAG (tag)], n_counts);
if (flag_dump_contents) if (flag_dump_contents)
...@@ -406,14 +391,14 @@ tag_counters (filename, tag, length) ...@@ -406,14 +391,14 @@ tag_counters (filename, tag, length)
for (ix = 0; ix != n_counts; ix++) for (ix = 0; ix != n_counts; ix++)
{ {
gcov_type count; gcov_type count;
if (!(ix & 7)) if (!(ix & 7))
{ {
printf ("\n"); printf ("\n");
print_prefix (filename, 0, gcov_position ()); print_prefix (filename, 0, gcov_position ());
printf ("\t\t%u", ix); printf ("\t\t%u", ix);
} }
count = gcov_read_counter (); count = gcov_read_counter ();
printf (" "); printf (" ");
printf (HOST_WIDEST_INT_PRINT_DEC, count); printf (HOST_WIDEST_INT_PRINT_DEC, count);
...@@ -422,24 +407,22 @@ tag_counters (filename, tag, length) ...@@ -422,24 +407,22 @@ tag_counters (filename, tag, length)
} }
static void static void
tag_summary (filename, tag, length) tag_summary (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
struct gcov_summary summary; struct gcov_summary summary;
unsigned ix; unsigned ix;
gcov_read_summary (&summary); gcov_read_summary (&summary);
printf (" checksum=0x%08x", summary.checksum); printf (" checksum=0x%08x", summary.checksum);
for (ix = 0; ix != GCOV_COUNTERS; ix++) for (ix = 0; ix != GCOV_COUNTERS; ix++)
{ {
printf ("\n"); printf ("\n");
print_prefix (filename, 0, 0); print_prefix (filename, 0, 0);
printf ("\t\tcounts=%u, runs=%u", printf ("\t\tcounts=%u, runs=%u",
summary.ctrs[ix].num, summary.ctrs[ix].runs); summary.ctrs[ix].num, summary.ctrs[ix].runs);
printf (", sum_all=" HOST_WIDEST_INT_PRINT_DEC, printf (", sum_all=" HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT)summary.ctrs[ix].sum_all); (HOST_WIDEST_INT)summary.ctrs[ix].sum_all);
printf (", run_max=" HOST_WIDEST_INT_PRINT_DEC, printf (", run_max=" HOST_WIDEST_INT_PRINT_DEC,
......
/* Generate gcov version string from version.c. See gcov-io.h for /* Generate gcov version string from version.c. See gcov-io.h for
description of how the version string is generated. 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> Contributed by Nathan Sidwell <nathan@codesourcery.com>
This file is part of GCC. This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under 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 ...@@ -26,12 +26,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h" #include "tm.h"
#include "version.c" /* We want the actual string. */ #include "version.c" /* We want the actual string. */
int main PARAMS ((int, char **)); int main (int, char **);
int int
main (argc, argv) main (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
int argc ATTRIBUTE_UNUSED;
char **argv;
{ {
unsigned version = 0; unsigned version = 0;
unsigned char v[4]; unsigned char v[4];
...@@ -56,7 +54,7 @@ main (argc, argv) ...@@ -56,7 +54,7 @@ main (argc, argv)
v[1] = (minor / 10) + '0'; v[1] = (minor / 10) + '0';
v[2] = (minor % 10) + '0'; v[2] = (minor % 10) + '0';
v[3] = s ? s : '*'; v[3] = s ? s : '*';
for (ix = 0; ix != 4; ix++) for (ix = 0; ix != 4; ix++)
version = (version << 8) | v[ix]; version = (version << 8) | v[ix];
...@@ -65,6 +63,6 @@ main (argc, argv) ...@@ -65,6 +63,6 @@ main (argc, argv)
printf ("\n"); printf ("\n");
printf ("#define GCOV_VERSION ((unsigned)%#08x) /* %.4s */\n", printf ("#define GCOV_VERSION ((unsigned)%#08x) /* %.4s */\n",
version, v); version, v);
return 0; return 0;
} }
...@@ -548,174 +548,166 @@ struct null_pointer_info ...@@ -548,174 +548,166 @@ struct null_pointer_info
sbitmap *nonnull_killed; sbitmap *nonnull_killed;
}; };
static void compute_can_copy PARAMS ((void)); static void compute_can_copy (void);
static char *gmalloc PARAMS ((unsigned int)); static char *gmalloc (unsigned int);
static char *grealloc PARAMS ((char *, unsigned int)); static char *grealloc (char *, unsigned int);
static char *gcse_alloc PARAMS ((unsigned long)); static char *gcse_alloc (unsigned long);
static void alloc_gcse_mem PARAMS ((rtx)); static void alloc_gcse_mem (rtx);
static void free_gcse_mem PARAMS ((void)); static void free_gcse_mem (void);
static void alloc_reg_set_mem PARAMS ((int)); static void alloc_reg_set_mem (int);
static void free_reg_set_mem PARAMS ((void)); static void free_reg_set_mem (void);
static int get_bitmap_width PARAMS ((int, int, int)); static int get_bitmap_width (int, int, int);
static void record_one_set PARAMS ((int, rtx)); static void record_one_set (int, rtx);
static void record_set_info PARAMS ((rtx, rtx, void *)); static void record_set_info (rtx, rtx, void *);
static void compute_sets PARAMS ((rtx)); static void compute_sets (rtx);
static void hash_scan_insn PARAMS ((rtx, struct hash_table *, int)); static void hash_scan_insn (rtx, struct hash_table *, int);
static void hash_scan_set PARAMS ((rtx, rtx, struct hash_table *)); static void hash_scan_set (rtx, rtx, struct hash_table *);
static void hash_scan_clobber PARAMS ((rtx, rtx, struct hash_table *)); static void hash_scan_clobber (rtx, rtx, struct hash_table *);
static void hash_scan_call PARAMS ((rtx, rtx, struct hash_table *)); static void hash_scan_call (rtx, rtx, struct hash_table *);
static int want_to_gcse_p PARAMS ((rtx)); static int want_to_gcse_p (rtx);
static bool gcse_constant_p PARAMS ((rtx)); static bool gcse_constant_p (rtx);
static int oprs_unchanged_p PARAMS ((rtx, rtx, int)); static int oprs_unchanged_p (rtx, rtx, int);
static int oprs_anticipatable_p PARAMS ((rtx, rtx)); static int oprs_anticipatable_p (rtx, rtx);
static int oprs_available_p PARAMS ((rtx, rtx)); static int oprs_available_p (rtx, rtx);
static void insert_expr_in_table PARAMS ((rtx, enum machine_mode, rtx, static void insert_expr_in_table (rtx, enum machine_mode, rtx, int, int,
int, int, struct hash_table *)); struct hash_table *);
static void insert_set_in_table PARAMS ((rtx, rtx, struct hash_table *)); static void insert_set_in_table (rtx, rtx, struct hash_table *);
static unsigned int hash_expr PARAMS ((rtx, enum machine_mode, int *, int)); static unsigned int hash_expr (rtx, enum machine_mode, int *, int);
static unsigned int hash_expr_1 PARAMS ((rtx, enum machine_mode, int *)); static unsigned int hash_expr_1 (rtx, enum machine_mode, int *);
static unsigned int hash_string_1 PARAMS ((const char *)); static unsigned int hash_string_1 (const char *);
static unsigned int hash_set PARAMS ((int, int)); static unsigned int hash_set (int, int);
static int expr_equiv_p PARAMS ((rtx, rtx)); static int expr_equiv_p (rtx, rtx);
static void record_last_reg_set_info PARAMS ((rtx, int)); static void record_last_reg_set_info (rtx, int);
static void record_last_mem_set_info PARAMS ((rtx)); static void record_last_mem_set_info (rtx);
static void record_last_set_info PARAMS ((rtx, rtx, void *)); static void record_last_set_info (rtx, rtx, void *);
static void compute_hash_table PARAMS ((struct hash_table *)); static void compute_hash_table (struct hash_table *);
static void alloc_hash_table PARAMS ((int, struct hash_table *, int)); static void alloc_hash_table (int, struct hash_table *, int);
static void free_hash_table PARAMS ((struct hash_table *)); static void free_hash_table (struct hash_table *);
static void compute_hash_table_work PARAMS ((struct hash_table *)); static void compute_hash_table_work (struct hash_table *);
static void dump_hash_table PARAMS ((FILE *, const char *, static void dump_hash_table (FILE *, const char *, struct hash_table *);
struct hash_table *)); static struct expr *lookup_expr (rtx, struct hash_table *);
static struct expr *lookup_expr PARAMS ((rtx, struct hash_table *)); static struct expr *lookup_set (unsigned int, struct hash_table *);
static struct expr *lookup_set PARAMS ((unsigned int, struct hash_table *)); static struct expr *next_set (unsigned int, struct expr *);
static struct expr *next_set PARAMS ((unsigned int, struct expr *)); static void reset_opr_set_tables (void);
static void reset_opr_set_tables PARAMS ((void)); static int oprs_not_set_p (rtx, rtx);
static int oprs_not_set_p PARAMS ((rtx, rtx)); static void mark_call (rtx);
static void mark_call PARAMS ((rtx)); static void mark_set (rtx, rtx);
static void mark_set PARAMS ((rtx, rtx)); static void mark_clobber (rtx, rtx);
static void mark_clobber PARAMS ((rtx, rtx)); static void mark_oprs_set (rtx);
static void mark_oprs_set PARAMS ((rtx)); static void alloc_cprop_mem (int, int);
static void alloc_cprop_mem PARAMS ((int, int)); static void free_cprop_mem (void);
static void free_cprop_mem PARAMS ((void)); static void compute_transp (rtx, int, sbitmap *, int);
static void compute_transp PARAMS ((rtx, int, sbitmap *, int)); static void compute_transpout (void);
static void compute_transpout PARAMS ((void)); static void compute_local_properties (sbitmap *, sbitmap *, sbitmap *,
static void compute_local_properties PARAMS ((sbitmap *, sbitmap *, sbitmap *, struct hash_table *);
struct hash_table *)); static void compute_cprop_data (void);
static void compute_cprop_data PARAMS ((void)); static void find_used_regs (rtx *, void *);
static void find_used_regs PARAMS ((rtx *, void *)); static int try_replace_reg (rtx, rtx, rtx);
static int try_replace_reg PARAMS ((rtx, rtx, rtx)); static struct expr *find_avail_set (int, rtx);
static struct expr *find_avail_set PARAMS ((int, rtx)); static int cprop_jump (basic_block, rtx, rtx, rtx, rtx);
static int cprop_jump PARAMS ((basic_block, rtx, rtx, rtx, rtx)); static void mems_conflict_for_gcse_p (rtx, rtx, void *);
static void mems_conflict_for_gcse_p PARAMS ((rtx, rtx, void *)); static int load_killed_in_block_p (basic_block, int, rtx, int);
static int load_killed_in_block_p PARAMS ((basic_block, int, rtx, int)); static void canon_list_insert (rtx, rtx, void *);
static void canon_list_insert PARAMS ((rtx, rtx, void *)); static int cprop_insn (rtx, int);
static int cprop_insn PARAMS ((rtx, int)); static int cprop (int);
static int cprop PARAMS ((int)); static void find_implicit_sets (void);
static void find_implicit_sets PARAMS ((void)); static int one_cprop_pass (int, int, int);
static int one_cprop_pass PARAMS ((int, int, int)); static bool constprop_register (rtx, rtx, rtx, int);
static bool constprop_register PARAMS ((rtx, rtx, rtx, int)); static struct expr *find_bypass_set (int, int);
static struct expr *find_bypass_set PARAMS ((int, int)); static bool reg_killed_on_edge (rtx, edge);
static bool reg_killed_on_edge PARAMS ((rtx, edge)); static int bypass_block (basic_block, rtx, rtx);
static int bypass_block PARAMS ((basic_block, rtx, rtx)); static int bypass_conditional_jumps (void);
static int bypass_conditional_jumps PARAMS ((void)); static void alloc_pre_mem (int, int);
static void alloc_pre_mem PARAMS ((int, int)); static void free_pre_mem (void);
static void free_pre_mem PARAMS ((void)); static void compute_pre_data (void);
static void compute_pre_data PARAMS ((void)); static int pre_expr_reaches_here_p (basic_block, struct expr *,
static int pre_expr_reaches_here_p PARAMS ((basic_block, struct expr *, basic_block);
basic_block)); static void insert_insn_end_bb (struct expr *, basic_block, int);
static void insert_insn_end_bb PARAMS ((struct expr *, basic_block, int)); static void pre_insert_copy_insn (struct expr *, rtx);
static void pre_insert_copy_insn PARAMS ((struct expr *, rtx)); static void pre_insert_copies (void);
static void pre_insert_copies PARAMS ((void)); static int pre_delete (void);
static int pre_delete PARAMS ((void)); static int pre_gcse (void);
static int pre_gcse PARAMS ((void)); static int one_pre_gcse_pass (int);
static int one_pre_gcse_pass PARAMS ((int)); static void add_label_notes (rtx, rtx);
static void add_label_notes PARAMS ((rtx, rtx)); static void alloc_code_hoist_mem (int, int);
static void alloc_code_hoist_mem PARAMS ((int, int)); static void free_code_hoist_mem (void);
static void free_code_hoist_mem PARAMS ((void)); static void compute_code_hoist_vbeinout (void);
static void compute_code_hoist_vbeinout PARAMS ((void)); static void compute_code_hoist_data (void);
static void compute_code_hoist_data PARAMS ((void)); static int hoist_expr_reaches_here_p (basic_block, int, basic_block, char *);
static int hoist_expr_reaches_here_p PARAMS ((basic_block, int, basic_block, static void hoist_code (void);
char *)); static int one_code_hoisting_pass (void);
static void hoist_code PARAMS ((void)); static void alloc_rd_mem (int, int);
static int one_code_hoisting_pass PARAMS ((void)); static void free_rd_mem (void);
static void alloc_rd_mem PARAMS ((int, int)); static void handle_rd_kill_set (rtx, int, basic_block);
static void free_rd_mem PARAMS ((void)); static void compute_kill_rd (void);
static void handle_rd_kill_set PARAMS ((rtx, int, basic_block)); static void compute_rd (void);
static void compute_kill_rd PARAMS ((void)); static void alloc_avail_expr_mem (int, int);
static void compute_rd PARAMS ((void)); static void free_avail_expr_mem (void);
static void alloc_avail_expr_mem PARAMS ((int, int)); static void compute_ae_gen (struct hash_table *);
static void free_avail_expr_mem PARAMS ((void)); static int expr_killed_p (rtx, basic_block);
static void compute_ae_gen PARAMS ((struct hash_table *)); static void compute_ae_kill (sbitmap *, sbitmap *, struct hash_table *);
static int expr_killed_p PARAMS ((rtx, basic_block)); static int expr_reaches_here_p (struct occr *, struct expr *, basic_block,
static void compute_ae_kill PARAMS ((sbitmap *, sbitmap *, struct hash_table *)); int);
static int expr_reaches_here_p PARAMS ((struct occr *, struct expr *, static rtx computing_insn (struct expr *, rtx);
basic_block, int)); static int def_reaches_here_p (rtx, rtx);
static rtx computing_insn PARAMS ((struct expr *, rtx)); static int can_disregard_other_sets (struct reg_set **, rtx, int);
static int def_reaches_here_p PARAMS ((rtx, rtx)); static int handle_avail_expr (rtx, struct expr *);
static int can_disregard_other_sets PARAMS ((struct reg_set **, rtx, int)); static int classic_gcse (void);
static int handle_avail_expr PARAMS ((rtx, struct expr *)); static int one_classic_gcse_pass (int);
static int classic_gcse PARAMS ((void)); static void invalidate_nonnull_info (rtx, rtx, void *);
static int one_classic_gcse_pass PARAMS ((int)); static int delete_null_pointer_checks_1 (unsigned int *, sbitmap *, sbitmap *,
static void invalidate_nonnull_info PARAMS ((rtx, rtx, void *)); struct null_pointer_info *);
static int delete_null_pointer_checks_1 PARAMS ((unsigned int *, static rtx process_insert_insn (struct expr *);
sbitmap *, sbitmap *, static int pre_edge_insert (struct edge_list *, struct expr **);
struct null_pointer_info *)); static int expr_reaches_here_p_work (struct occr *, struct expr *,
static rtx process_insert_insn PARAMS ((struct expr *)); basic_block, int, char *);
static int pre_edge_insert PARAMS ((struct edge_list *, struct expr **)); static int pre_expr_reaches_here_p_work (basic_block, struct expr *,
static int expr_reaches_here_p_work PARAMS ((struct occr *, struct expr *, basic_block, char *);
basic_block, int, char *)); static struct ls_expr * ldst_entry (rtx);
static int pre_expr_reaches_here_p_work PARAMS ((basic_block, struct expr *, static void free_ldst_entry (struct ls_expr *);
basic_block, char *)); static void free_ldst_mems (void);
static struct ls_expr * ldst_entry PARAMS ((rtx)); static void print_ldst_list (FILE *);
static void free_ldst_entry PARAMS ((struct ls_expr *)); static struct ls_expr * find_rtx_in_ldst (rtx);
static void free_ldst_mems PARAMS ((void)); static int enumerate_ldsts (void);
static void print_ldst_list PARAMS ((FILE *)); static inline struct ls_expr * first_ls_expr (void);
static struct ls_expr * find_rtx_in_ldst PARAMS ((rtx)); static inline struct ls_expr * next_ls_expr (struct ls_expr *);
static int enumerate_ldsts PARAMS ((void)); static int simple_mem (rtx);
static inline struct ls_expr * first_ls_expr PARAMS ((void)); static void invalidate_any_buried_refs (rtx);
static inline struct ls_expr * next_ls_expr PARAMS ((struct ls_expr *)); static void compute_ld_motion_mems (void);
static int simple_mem PARAMS ((rtx)); static void trim_ld_motion_mems (void);
static void invalidate_any_buried_refs PARAMS ((rtx)); static void update_ld_motion_stores (struct expr *);
static void compute_ld_motion_mems PARAMS ((void)); static void reg_set_info (rtx, rtx, void *);
static void trim_ld_motion_mems PARAMS ((void)); static bool store_ops_ok (rtx, int *);
static void update_ld_motion_stores PARAMS ((struct expr *)); static rtx extract_mentioned_regs (rtx);
static void reg_set_info PARAMS ((rtx, rtx, void *)); static rtx extract_mentioned_regs_helper (rtx, rtx);
static bool store_ops_ok PARAMS ((rtx, int *)); static void find_moveable_store (rtx, int *, int *);
static rtx extract_mentioned_regs PARAMS ((rtx)); static int compute_store_table (void);
static rtx extract_mentioned_regs_helper PARAMS ((rtx, rtx)); static bool load_kills_store (rtx, rtx);
static void find_moveable_store PARAMS ((rtx, int *, int *)); static bool find_loads (rtx, rtx);
static int compute_store_table PARAMS ((void)); static bool store_killed_in_insn (rtx, rtx, rtx);
static bool load_kills_store PARAMS ((rtx, rtx)); static bool store_killed_after (rtx, rtx, rtx, basic_block, int *, rtx *);
static bool find_loads PARAMS ((rtx, rtx)); static bool store_killed_before (rtx, rtx, rtx, basic_block, int *);
static bool store_killed_in_insn PARAMS ((rtx, rtx, rtx)); static void build_store_vectors (void);
static bool store_killed_after PARAMS ((rtx, rtx, rtx, basic_block, static void insert_insn_start_bb (rtx, basic_block);
int *, rtx *)); static int insert_store (struct ls_expr *, edge);
static bool store_killed_before PARAMS ((rtx, rtx, rtx, basic_block, static void replace_store_insn (rtx, rtx, basic_block);
int *)); static void delete_store (struct ls_expr *, basic_block);
static void build_store_vectors PARAMS ((void)); static void free_store_memory (void);
static void insert_insn_start_bb PARAMS ((rtx, basic_block)); static void store_motion (void);
static int insert_store PARAMS ((struct ls_expr *, edge)); static void free_insn_expr_list_list (rtx *);
static void replace_store_insn PARAMS ((rtx, rtx, basic_block)); static void clear_modify_mem_tables (void);
static void delete_store PARAMS ((struct ls_expr *, static void free_modify_mem_tables (void);
basic_block)); static rtx gcse_emit_move_after (rtx, rtx, rtx);
static void free_store_memory PARAMS ((void)); static void local_cprop_find_used_regs (rtx *, void *);
static void store_motion PARAMS ((void)); static bool do_local_cprop (rtx, rtx, int, rtx*);
static void free_insn_expr_list_list PARAMS ((rtx *)); static bool adjust_libcall_notes (rtx, rtx, rtx, rtx*);
static void clear_modify_mem_tables PARAMS ((void)); static void local_cprop_pass (int);
static void free_modify_mem_tables PARAMS ((void));
static rtx gcse_emit_move_after PARAMS ((rtx, rtx, rtx));
static void local_cprop_find_used_regs PARAMS ((rtx *, void *));
static bool do_local_cprop PARAMS ((rtx, rtx, int, rtx*));
static bool adjust_libcall_notes PARAMS ((rtx, rtx, rtx, rtx*));
static void local_cprop_pass PARAMS ((int));
/* Entry point for global common subexpression elimination. /* Entry point for global common subexpression elimination.
F is the first instruction in the function. */ F is the first instruction in the function. */
int int
gcse_main (f, file) gcse_main (rtx f, FILE *file)
rtx f;
FILE *file;
{ {
int changed, pass; int changed, pass;
/* Bytes used at start of pass. */ /* Bytes used at start of pass. */
...@@ -917,7 +909,7 @@ static char can_copy[(int) NUM_MACHINE_MODES]; ...@@ -917,7 +909,7 @@ static char can_copy[(int) NUM_MACHINE_MODES];
/* Compute which modes support reg/reg copy operations. */ /* Compute which modes support reg/reg copy operations. */
static void static void
compute_can_copy () compute_can_copy (void)
{ {
int i; int i;
#ifndef AVOID_CCMODE_COPIES #ifndef AVOID_CCMODE_COPIES
...@@ -947,8 +939,7 @@ compute_can_copy () ...@@ -947,8 +939,7 @@ compute_can_copy ()
/* Returns whether the mode supports reg/reg copy operations. */ /* Returns whether the mode supports reg/reg copy operations. */
bool bool
can_copy_p (mode) can_copy_p (enum machine_mode mode)
enum machine_mode mode;
{ {
static bool can_copy_init_p = false; static bool can_copy_init_p = false;
...@@ -964,8 +955,7 @@ can_copy_p (mode) ...@@ -964,8 +955,7 @@ can_copy_p (mode)
/* Cover function to xmalloc to record bytes allocated. */ /* Cover function to xmalloc to record bytes allocated. */
static char * static char *
gmalloc (size) gmalloc (unsigned int size)
unsigned int size;
{ {
bytes_used += size; bytes_used += size;
return xmalloc (size); return xmalloc (size);
...@@ -976,9 +966,7 @@ gmalloc (size) ...@@ -976,9 +966,7 @@ gmalloc (size)
It won't affect memory usage stats much anyway. */ It won't affect memory usage stats much anyway. */
static char * static char *
grealloc (ptr, size) grealloc (char *ptr, unsigned int size)
char *ptr;
unsigned int size;
{ {
return xrealloc (ptr, size); return xrealloc (ptr, size);
} }
...@@ -986,8 +974,7 @@ grealloc (ptr, size) ...@@ -986,8 +974,7 @@ grealloc (ptr, size)
/* Cover function to obstack_alloc. */ /* Cover function to obstack_alloc. */
static char * static char *
gcse_alloc (size) gcse_alloc (unsigned long size)
unsigned long size;
{ {
bytes_used += size; bytes_used += size;
return (char *) obstack_alloc (&gcse_obstack, size); return (char *) obstack_alloc (&gcse_obstack, size);
...@@ -999,8 +986,7 @@ gcse_alloc (size) ...@@ -999,8 +986,7 @@ gcse_alloc (size)
This is called at the start of each pass. */ This is called at the start of each pass. */
static void static void
alloc_gcse_mem (f) alloc_gcse_mem (rtx f)
rtx f;
{ {
int i, n; int i, n;
rtx insn; rtx insn;
...@@ -1050,7 +1036,7 @@ alloc_gcse_mem (f) ...@@ -1050,7 +1036,7 @@ alloc_gcse_mem (f)
/* Free memory allocated by alloc_gcse_mem. */ /* Free memory allocated by alloc_gcse_mem. */
static void static void
free_gcse_mem () free_gcse_mem (void)
{ {
free (uid_cuid); free (uid_cuid);
free (cuid_insn); free (cuid_insn);
...@@ -1081,10 +1067,7 @@ free_gcse_mem () ...@@ -1081,10 +1067,7 @@ free_gcse_mem ()
less space. */ less space. */
static int static int
get_bitmap_width (n, x, y) get_bitmap_width (int n, int x, int y)
int n;
int x;
int y;
{ {
/* It's not really worth figuring out *exactly* how much memory will /* It's not really worth figuring out *exactly* how much memory will
be used by a particular choice. The important thing is to get be used by a particular choice. The important thing is to get
...@@ -1134,11 +1117,7 @@ get_bitmap_width (n, x, y) ...@@ -1134,11 +1117,7 @@ get_bitmap_width (n, x, y)
ABSALTERED. */ ABSALTERED. */
static void static void
compute_local_properties (transp, comp, antloc, table) compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc, struct hash_table *table)
sbitmap *transp;
sbitmap *comp;
sbitmap *antloc;
struct hash_table *table;
{ {
unsigned int i; unsigned int i;
...@@ -1210,8 +1189,7 @@ compute_local_properties (transp, comp, antloc, table) ...@@ -1210,8 +1189,7 @@ compute_local_properties (transp, comp, antloc, table)
static struct obstack reg_set_obstack; static struct obstack reg_set_obstack;
static void static void
alloc_reg_set_mem (n_regs) alloc_reg_set_mem (int n_regs)
int n_regs;
{ {
unsigned int n; unsigned int n;
...@@ -1224,7 +1202,7 @@ alloc_reg_set_mem (n_regs) ...@@ -1224,7 +1202,7 @@ alloc_reg_set_mem (n_regs)
} }
static void static void
free_reg_set_mem () free_reg_set_mem (void)
{ {
free (reg_set_table); free (reg_set_table);
obstack_free (&reg_set_obstack, NULL); obstack_free (&reg_set_obstack, NULL);
...@@ -1233,9 +1211,7 @@ free_reg_set_mem () ...@@ -1233,9 +1211,7 @@ free_reg_set_mem ()
/* Record REGNO in the reg_set table. */ /* Record REGNO in the reg_set table. */
static void static void
record_one_set (regno, insn) record_one_set (int regno, rtx insn)
int regno;
rtx insn;
{ {
/* Allocate a new reg_set element and link it onto the list. */ /* Allocate a new reg_set element and link it onto the list. */
struct reg_set *new_reg_info; struct reg_set *new_reg_info;
...@@ -1266,9 +1242,7 @@ record_one_set (regno, insn) ...@@ -1266,9 +1242,7 @@ record_one_set (regno, insn)
occurring. */ occurring. */
static void static void
record_set_info (dest, setter, data) record_set_info (rtx dest, rtx setter ATTRIBUTE_UNUSED, void *data)
rtx dest, setter ATTRIBUTE_UNUSED;
void *data;
{ {
rtx record_set_insn = (rtx) data; rtx record_set_insn = (rtx) data;
...@@ -1282,8 +1256,7 @@ record_set_info (dest, setter, data) ...@@ -1282,8 +1256,7 @@ record_set_info (dest, setter, data)
`reg_set_table' for further documentation. */ `reg_set_table' for further documentation. */
static void static void
compute_sets (f) compute_sets (rtx f)
rtx f;
{ {
rtx insn; rtx insn;
...@@ -1310,8 +1283,7 @@ static basic_block current_bb; ...@@ -1310,8 +1283,7 @@ static basic_block current_bb;
static GTY(()) rtx test_insn; static GTY(()) rtx test_insn;
static int static int
want_to_gcse_p (x) want_to_gcse_p (rtx x)
rtx x;
{ {
int num_clobbers = 0; int num_clobbers = 0;
int icode; int icode;
...@@ -1362,9 +1334,7 @@ want_to_gcse_p (x) ...@@ -1362,9 +1334,7 @@ want_to_gcse_p (x)
or from INSN to the end of INSN's basic block (if AVAIL_P != 0). */ or from INSN to the end of INSN's basic block (if AVAIL_P != 0). */
static int static int
oprs_unchanged_p (x, insn, avail_p) oprs_unchanged_p (rtx x, rtx insn, int avail_p)
rtx x, insn;
int avail_p;
{ {
int i, j; int i, j;
enum rtx_code code; enum rtx_code code;
...@@ -1457,9 +1427,8 @@ static rtx gcse_mem_operand; ...@@ -1457,9 +1427,8 @@ static rtx gcse_mem_operand;
gcse_mems_conflict_p to a nonzero value. */ gcse_mems_conflict_p to a nonzero value. */
static void static void
mems_conflict_for_gcse_p (dest, setter, data) mems_conflict_for_gcse_p (rtx dest, rtx setter ATTRIBUTE_UNUSED,
rtx dest, setter ATTRIBUTE_UNUSED; void *data ATTRIBUTE_UNUSED)
void *data ATTRIBUTE_UNUSED;
{ {
while (GET_CODE (dest) == SUBREG while (GET_CODE (dest) == SUBREG
|| GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == ZERO_EXTRACT
...@@ -1497,11 +1466,7 @@ mems_conflict_for_gcse_p (dest, setter, data) ...@@ -1497,11 +1466,7 @@ mems_conflict_for_gcse_p (dest, setter, data)
AVAIL_P to 0. */ AVAIL_P to 0. */
static int static int
load_killed_in_block_p (bb, uid_limit, x, avail_p) load_killed_in_block_p (basic_block bb, int uid_limit, rtx x, int avail_p)
basic_block bb;
int uid_limit;
rtx x;
int avail_p;
{ {
rtx list_entry = modify_mem_list[bb->index]; rtx list_entry = modify_mem_list[bb->index];
while (list_entry) while (list_entry)
...@@ -1544,8 +1509,7 @@ load_killed_in_block_p (bb, uid_limit, x, avail_p) ...@@ -1544,8 +1509,7 @@ load_killed_in_block_p (bb, uid_limit, x, avail_p)
the start of INSN's basic block up to but not including INSN. */ the start of INSN's basic block up to but not including INSN. */
static int static int
oprs_anticipatable_p (x, insn) oprs_anticipatable_p (rtx x, rtx insn)
rtx x, insn;
{ {
return oprs_unchanged_p (x, insn, 0); return oprs_unchanged_p (x, insn, 0);
} }
...@@ -1554,8 +1518,7 @@ oprs_anticipatable_p (x, insn) ...@@ -1554,8 +1518,7 @@ oprs_anticipatable_p (x, insn)
INSN to the end of INSN's basic block. */ INSN to the end of INSN's basic block. */
static int static int
oprs_available_p (x, insn) oprs_available_p (rtx x, rtx insn)
rtx x, insn;
{ {
return oprs_unchanged_p (x, insn, 1); return oprs_unchanged_p (x, insn, 1);
} }
...@@ -1569,11 +1532,7 @@ oprs_available_p (x, insn) ...@@ -1569,11 +1532,7 @@ oprs_available_p (x, insn)
??? One might want to merge this with canon_hash. Later. */ ??? One might want to merge this with canon_hash. Later. */
static unsigned int static unsigned int
hash_expr (x, mode, do_not_record_p, hash_table_size) hash_expr (rtx x, enum machine_mode mode, int *do_not_record_p, int hash_table_size)
rtx x;
enum machine_mode mode;
int *do_not_record_p;
int hash_table_size;
{ {
unsigned int hash; unsigned int hash;
...@@ -1586,8 +1545,7 @@ hash_expr (x, mode, do_not_record_p, hash_table_size) ...@@ -1586,8 +1545,7 @@ hash_expr (x, mode, do_not_record_p, hash_table_size)
/* Hash a string. Just add its bytes up. */ /* Hash a string. Just add its bytes up. */
static inline unsigned static inline unsigned
hash_string_1 (ps) hash_string_1 (const char *ps)
const char *ps;
{ {
unsigned hash = 0; unsigned hash = 0;
const unsigned char *p = (const unsigned char *) ps; const unsigned char *p = (const unsigned char *) ps;
...@@ -1602,10 +1560,7 @@ hash_string_1 (ps) ...@@ -1602,10 +1560,7 @@ hash_string_1 (ps)
/* Subroutine of hash_expr to do the actual work. */ /* Subroutine of hash_expr to do the actual work. */
static unsigned int static unsigned int
hash_expr_1 (x, mode, do_not_record_p) hash_expr_1 (rtx x, enum machine_mode mode, int *do_not_record_p)
rtx x;
enum machine_mode mode;
int *do_not_record_p;
{ {
int i, j; int i, j;
unsigned hash = 0; unsigned hash = 0;
...@@ -1793,9 +1748,7 @@ hash_expr_1 (x, mode, do_not_record_p) ...@@ -1793,9 +1748,7 @@ hash_expr_1 (x, mode, do_not_record_p)
??? May need to make things more elaborate. Later, as necessary. */ ??? May need to make things more elaborate. Later, as necessary. */
static unsigned int static unsigned int
hash_set (regno, hash_table_size) hash_set (int regno, int hash_table_size)
int regno;
int hash_table_size;
{ {
unsigned int hash; unsigned int hash;
...@@ -1807,8 +1760,7 @@ hash_set (regno, hash_table_size) ...@@ -1807,8 +1760,7 @@ hash_set (regno, hash_table_size)
??? Borrowed from cse.c. Might want to remerge with cse.c. Later. */ ??? Borrowed from cse.c. Might want to remerge with cse.c. Later. */
static int static int
expr_equiv_p (x, y) expr_equiv_p (rtx x, rtx y)
rtx x, y;
{ {
int i, j; int i, j;
enum rtx_code code; enum rtx_code code;
...@@ -1955,12 +1907,8 @@ expr_equiv_p (x, y) ...@@ -1955,12 +1907,8 @@ expr_equiv_p (x, y)
AVAIL_P is nonzero if X is an available expression. */ AVAIL_P is nonzero if X is an available expression. */
static void static void
insert_expr_in_table (x, mode, insn, antic_p, avail_p, table) insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
rtx x; int avail_p, struct hash_table *table)
enum machine_mode mode;
rtx insn;
int antic_p, avail_p;
struct hash_table *table;
{ {
int found, do_not_record_p; int found, do_not_record_p;
unsigned int hash; unsigned int hash;
...@@ -2084,10 +2032,7 @@ insert_expr_in_table (x, mode, insn, antic_p, avail_p, table) ...@@ -2084,10 +2032,7 @@ insert_expr_in_table (x, mode, insn, antic_p, avail_p, table)
basic block. */ basic block. */
static void static void
insert_set_in_table (x, insn, table) insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
rtx x;
rtx insn;
struct hash_table *table;
{ {
int found; int found;
unsigned int hash; unsigned int hash;
...@@ -2170,8 +2115,7 @@ insert_set_in_table (x, insn, table) ...@@ -2170,8 +2115,7 @@ insert_set_in_table (x, insn, table)
the purposes of GCSE's constant propagation. */ the purposes of GCSE's constant propagation. */
static bool static bool
gcse_constant_p (x) gcse_constant_p (rtx x)
rtx x;
{ {
/* Consider a COMPARE of two integers constant. */ /* Consider a COMPARE of two integers constant. */
if (GET_CODE (x) == COMPARE if (GET_CODE (x) == COMPARE
...@@ -2189,9 +2133,7 @@ gcse_constant_p (x) ...@@ -2189,9 +2133,7 @@ gcse_constant_p (x)
expression one). */ expression one). */
static void static void
hash_scan_set (pat, insn, table) hash_scan_set (rtx pat, rtx insn, struct hash_table *table)
rtx pat, insn;
struct hash_table *table;
{ {
rtx src = SET_SRC (pat); rtx src = SET_SRC (pat);
rtx dest = SET_DEST (pat); rtx dest = SET_DEST (pat);
...@@ -2265,17 +2207,15 @@ hash_scan_set (pat, insn, table) ...@@ -2265,17 +2207,15 @@ hash_scan_set (pat, insn, table)
} }
static void static void
hash_scan_clobber (x, insn, table) hash_scan_clobber (rtx x ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED,
rtx x ATTRIBUTE_UNUSED, insn ATTRIBUTE_UNUSED; struct hash_table *table ATTRIBUTE_UNUSED)
struct hash_table *table ATTRIBUTE_UNUSED;
{ {
/* Currently nothing to do. */ /* Currently nothing to do. */
} }
static void static void
hash_scan_call (x, insn, table) hash_scan_call (rtx x ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED,
rtx x ATTRIBUTE_UNUSED, insn ATTRIBUTE_UNUSED; struct hash_table *table ATTRIBUTE_UNUSED)
struct hash_table *table ATTRIBUTE_UNUSED;
{ {
/* Currently nothing to do. */ /* Currently nothing to do. */
} }
...@@ -2294,10 +2234,7 @@ hash_scan_call (x, insn, table) ...@@ -2294,10 +2234,7 @@ hash_scan_call (x, insn, table)
not record any expressions. */ not record any expressions. */
static void static void
hash_scan_insn (insn, table, in_libcall_block) hash_scan_insn (rtx insn, struct hash_table *table, int in_libcall_block)
rtx insn;
struct hash_table *table;
int in_libcall_block;
{ {
rtx pat = PATTERN (insn); rtx pat = PATTERN (insn);
int i; int i;
...@@ -2330,10 +2267,7 @@ hash_scan_insn (insn, table, in_libcall_block) ...@@ -2330,10 +2267,7 @@ hash_scan_insn (insn, table, in_libcall_block)
} }
static void static void
dump_hash_table (file, name, table) dump_hash_table (FILE *file, const char *name, struct hash_table *table)
FILE *file;
const char *name;
struct hash_table *table;
{ {
int i; int i;
/* Flattened out table, so it's printed in proper order. */ /* Flattened out table, so it's printed in proper order. */
...@@ -2386,9 +2320,7 @@ dump_hash_table (file, name, table) ...@@ -2386,9 +2320,7 @@ dump_hash_table (file, name, table)
and is used to compute "transparency". */ and is used to compute "transparency". */
static void static void
record_last_reg_set_info (insn, regno) record_last_reg_set_info (rtx insn, int regno)
rtx insn;
int regno;
{ {
struct reg_avail_info *info = &reg_avail_info[regno]; struct reg_avail_info *info = &reg_avail_info[regno];
int cuid = INSN_CUID (insn); int cuid = INSN_CUID (insn);
...@@ -2408,10 +2340,8 @@ record_last_reg_set_info (insn, regno) ...@@ -2408,10 +2340,8 @@ record_last_reg_set_info (insn, regno)
taken off pairwise. */ taken off pairwise. */
static void static void
canon_list_insert (dest, unused1, v_insn) canon_list_insert (rtx dest ATTRIBUTE_UNUSED, rtx unused1 ATTRIBUTE_UNUSED,
rtx dest ATTRIBUTE_UNUSED; void * v_insn)
rtx unused1 ATTRIBUTE_UNUSED;
void * v_insn;
{ {
rtx dest_addr, insn; rtx dest_addr, insn;
int bb; int bb;
...@@ -2446,8 +2376,7 @@ canon_list_insert (dest, unused1, v_insn) ...@@ -2446,8 +2376,7 @@ canon_list_insert (dest, unused1, v_insn)
a CALL_INSN). We merely need to record which insns modify memory. */ a CALL_INSN). We merely need to record which insns modify memory. */
static void static void
record_last_mem_set_info (insn) record_last_mem_set_info (rtx insn)
rtx insn;
{ {
int bb = BLOCK_NUM (insn); int bb = BLOCK_NUM (insn);
...@@ -2474,9 +2403,7 @@ record_last_mem_set_info (insn) ...@@ -2474,9 +2403,7 @@ record_last_mem_set_info (insn)
the SET is taking place. */ the SET is taking place. */
static void static void
record_last_set_info (dest, setter, data) record_last_set_info (rtx dest, rtx setter ATTRIBUTE_UNUSED, void *data)
rtx dest, setter ATTRIBUTE_UNUSED;
void *data;
{ {
rtx last_set_insn = (rtx) data; rtx last_set_insn = (rtx) data;
...@@ -2508,8 +2435,7 @@ record_last_set_info (dest, setter, data) ...@@ -2508,8 +2435,7 @@ record_last_set_info (dest, setter, data)
TABLE is the table computed. */ TABLE is the table computed. */
static void static void
compute_hash_table_work (table) compute_hash_table_work (struct hash_table *table)
struct hash_table *table;
{ {
unsigned int i; unsigned int i;
...@@ -2600,10 +2526,7 @@ compute_hash_table_work (table) ...@@ -2600,10 +2526,7 @@ compute_hash_table_work (table)
be created. */ be created. */
static void static void
alloc_hash_table (n_insns, table, set_p) alloc_hash_table (int n_insns, struct hash_table *table, int set_p)
int n_insns;
struct hash_table *table;
int set_p;
{ {
int n; int n;
...@@ -2623,8 +2546,7 @@ alloc_hash_table (n_insns, table, set_p) ...@@ -2623,8 +2546,7 @@ alloc_hash_table (n_insns, table, set_p)
/* Free things allocated by alloc_hash_table. */ /* Free things allocated by alloc_hash_table. */
static void static void
free_hash_table (table) free_hash_table (struct hash_table *table)
struct hash_table *table;
{ {
free (table->table); free (table->table);
} }
...@@ -2633,8 +2555,7 @@ free_hash_table (table) ...@@ -2633,8 +2555,7 @@ free_hash_table (table)
expression hash table. */ expression hash table. */
static void static void
compute_hash_table (table) compute_hash_table (struct hash_table *table)
struct hash_table *table;
{ {
/* Initialize count of number of entries in hash table. */ /* Initialize count of number of entries in hash table. */
table->n_elems = 0; table->n_elems = 0;
...@@ -2650,9 +2571,7 @@ compute_hash_table (table) ...@@ -2650,9 +2571,7 @@ compute_hash_table (table)
The result is a pointer to the table entry, or NULL if not found. */ The result is a pointer to the table entry, or NULL if not found. */
static struct expr * static struct expr *
lookup_expr (pat, table) lookup_expr (rtx pat, struct hash_table *table)
rtx pat;
struct hash_table *table;
{ {
int do_not_record_p; int do_not_record_p;
unsigned int hash = hash_expr (pat, GET_MODE (pat), &do_not_record_p, unsigned int hash = hash_expr (pat, GET_MODE (pat), &do_not_record_p,
...@@ -2674,9 +2593,7 @@ lookup_expr (pat, table) ...@@ -2674,9 +2593,7 @@ lookup_expr (pat, table)
table entry, or NULL if not found. */ table entry, or NULL if not found. */
static struct expr * static struct expr *
lookup_set (regno, table) lookup_set (unsigned int regno, struct hash_table *table)
unsigned int regno;
struct hash_table *table;
{ {
unsigned int hash = hash_set (regno, table->size); unsigned int hash = hash_set (regno, table->size);
struct expr *expr; struct expr *expr;
...@@ -2692,9 +2609,7 @@ lookup_set (regno, table) ...@@ -2692,9 +2609,7 @@ lookup_set (regno, table)
/* Return the next entry for REGNO in list EXPR. */ /* Return the next entry for REGNO in list EXPR. */
static struct expr * static struct expr *
next_set (regno, expr) next_set (unsigned int regno, struct expr *expr)
unsigned int regno;
struct expr *expr;
{ {
do do
expr = expr->next_same_hash; expr = expr->next_same_hash;
...@@ -2707,8 +2622,7 @@ next_set (regno, expr) ...@@ -2707,8 +2622,7 @@ next_set (regno, expr)
types may be mixed. */ types may be mixed. */
static void static void
free_insn_expr_list_list (listp) free_insn_expr_list_list (rtx *listp)
rtx *listp;
{ {
rtx list, next; rtx list, next;
...@@ -2726,7 +2640,7 @@ free_insn_expr_list_list (listp) ...@@ -2726,7 +2640,7 @@ free_insn_expr_list_list (listp)
/* Clear canon_modify_mem_list and modify_mem_list tables. */ /* Clear canon_modify_mem_list and modify_mem_list tables. */
static void static void
clear_modify_mem_tables () clear_modify_mem_tables (void)
{ {
int i; int i;
...@@ -2743,7 +2657,7 @@ clear_modify_mem_tables () ...@@ -2743,7 +2657,7 @@ clear_modify_mem_tables ()
/* Release memory used by modify_mem_list_set and canon_modify_mem_list_set. */ /* Release memory used by modify_mem_list_set and canon_modify_mem_list_set. */
static void static void
free_modify_mem_tables () free_modify_mem_tables (void)
{ {
clear_modify_mem_tables (); clear_modify_mem_tables ();
free (modify_mem_list); free (modify_mem_list);
...@@ -2756,7 +2670,7 @@ free_modify_mem_tables () ...@@ -2756,7 +2670,7 @@ free_modify_mem_tables ()
start of the block]. */ start of the block]. */
static void static void
reset_opr_set_tables () reset_opr_set_tables (void)
{ {
/* Maintain a bitmap of which regs have been set since beginning of /* Maintain a bitmap of which regs have been set since beginning of
the block. */ the block. */
...@@ -2772,8 +2686,7 @@ reset_opr_set_tables () ...@@ -2772,8 +2686,7 @@ reset_opr_set_tables ()
INSN's basic block. */ INSN's basic block. */
static int static int
oprs_not_set_p (x, insn) oprs_not_set_p (rtx x, rtx insn)
rtx x, insn;
{ {
int i, j; int i, j;
enum rtx_code code; enum rtx_code code;
...@@ -2836,8 +2749,7 @@ oprs_not_set_p (x, insn) ...@@ -2836,8 +2749,7 @@ oprs_not_set_p (x, insn)
/* Mark things set by a CALL. */ /* Mark things set by a CALL. */
static void static void
mark_call (insn) mark_call (rtx insn)
rtx insn;
{ {
if (! CONST_OR_PURE_CALL_P (insn)) if (! CONST_OR_PURE_CALL_P (insn))
record_last_mem_set_info (insn); record_last_mem_set_info (insn);
...@@ -2846,8 +2758,7 @@ mark_call (insn) ...@@ -2846,8 +2758,7 @@ mark_call (insn)
/* Mark things set by a SET. */ /* Mark things set by a SET. */
static void static void
mark_set (pat, insn) mark_set (rtx pat, rtx insn)
rtx pat, insn;
{ {
rtx dest = SET_DEST (pat); rtx dest = SET_DEST (pat);
...@@ -2869,8 +2780,7 @@ mark_set (pat, insn) ...@@ -2869,8 +2780,7 @@ mark_set (pat, insn)
/* Record things set by a CLOBBER. */ /* Record things set by a CLOBBER. */
static void static void
mark_clobber (pat, insn) mark_clobber (rtx pat, rtx insn)
rtx pat, insn;
{ {
rtx clob = XEXP (pat, 0); rtx clob = XEXP (pat, 0);
...@@ -2887,8 +2797,7 @@ mark_clobber (pat, insn) ...@@ -2887,8 +2797,7 @@ mark_clobber (pat, insn)
This data is used by oprs_not_set_p. */ This data is used by oprs_not_set_p. */
static void static void
mark_oprs_set (insn) mark_oprs_set (rtx insn)
rtx insn;
{ {
rtx pat = PATTERN (insn); rtx pat = PATTERN (insn);
int i; int i;
...@@ -2920,8 +2829,7 @@ mark_oprs_set (insn) ...@@ -2920,8 +2829,7 @@ mark_oprs_set (insn)
/* Allocate reaching def variables. */ /* Allocate reaching def variables. */
static void static void
alloc_rd_mem (n_blocks, n_insns) alloc_rd_mem (int n_blocks, int n_insns)
int n_blocks, n_insns;
{ {
rd_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns); rd_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_kill, n_blocks); sbitmap_vector_zero (rd_kill, n_blocks);
...@@ -2939,7 +2847,7 @@ alloc_rd_mem (n_blocks, n_insns) ...@@ -2939,7 +2847,7 @@ alloc_rd_mem (n_blocks, n_insns)
/* Free reaching def variables. */ /* Free reaching def variables. */
static void static void
free_rd_mem () free_rd_mem (void)
{ {
sbitmap_vector_free (rd_kill); sbitmap_vector_free (rd_kill);
sbitmap_vector_free (rd_gen); sbitmap_vector_free (rd_gen);
...@@ -2950,10 +2858,7 @@ free_rd_mem () ...@@ -2950,10 +2858,7 @@ free_rd_mem ()
/* Add INSN to the kills of BB. REGNO, set in BB, is killed by INSN. */ /* Add INSN to the kills of BB. REGNO, set in BB, is killed by INSN. */
static void static void
handle_rd_kill_set (insn, regno, bb) handle_rd_kill_set (rtx insn, int regno, basic_block bb)
rtx insn;
int regno;
basic_block bb;
{ {
struct reg_set *this_reg; struct reg_set *this_reg;
...@@ -2965,7 +2870,7 @@ handle_rd_kill_set (insn, regno, bb) ...@@ -2965,7 +2870,7 @@ handle_rd_kill_set (insn, regno, bb)
/* Compute the set of kill's for reaching definitions. */ /* Compute the set of kill's for reaching definitions. */
static void static void
compute_kill_rd () compute_kill_rd (void)
{ {
int cuid; int cuid;
unsigned int regno; unsigned int regno;
...@@ -3020,7 +2925,7 @@ compute_kill_rd () ...@@ -3020,7 +2925,7 @@ compute_kill_rd ()
expressions but applied to the gens and kills of reaching definitions. */ expressions but applied to the gens and kills of reaching definitions. */
static void static void
compute_rd () compute_rd (void)
{ {
int changed, passes; int changed, passes;
basic_block bb; basic_block bb;
...@@ -3051,8 +2956,7 @@ compute_rd () ...@@ -3051,8 +2956,7 @@ compute_rd ()
/* Allocate memory for available expression computation. */ /* Allocate memory for available expression computation. */
static void static void
alloc_avail_expr_mem (n_blocks, n_exprs) alloc_avail_expr_mem (int n_blocks, int n_exprs)
int n_blocks, n_exprs;
{ {
ae_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs); ae_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_kill, n_blocks); sbitmap_vector_zero (ae_kill, n_blocks);
...@@ -3068,7 +2972,7 @@ alloc_avail_expr_mem (n_blocks, n_exprs) ...@@ -3068,7 +2972,7 @@ alloc_avail_expr_mem (n_blocks, n_exprs)
} }
static void static void
free_avail_expr_mem () free_avail_expr_mem (void)
{ {
sbitmap_vector_free (ae_kill); sbitmap_vector_free (ae_kill);
sbitmap_vector_free (ae_gen); sbitmap_vector_free (ae_gen);
...@@ -3079,8 +2983,7 @@ free_avail_expr_mem () ...@@ -3079,8 +2983,7 @@ free_avail_expr_mem ()
/* Compute the set of available expressions generated in each basic block. */ /* Compute the set of available expressions generated in each basic block. */
static void static void
compute_ae_gen (expr_hash_table) compute_ae_gen (struct hash_table *expr_hash_table)
struct hash_table *expr_hash_table;
{ {
unsigned int i; unsigned int i;
struct expr *expr; struct expr *expr;
...@@ -3099,9 +3002,7 @@ compute_ae_gen (expr_hash_table) ...@@ -3099,9 +3002,7 @@ compute_ae_gen (expr_hash_table)
/* Return nonzero if expression X is killed in BB. */ /* Return nonzero if expression X is killed in BB. */
static int static int
expr_killed_p (x, bb) expr_killed_p (rtx x, basic_block bb)
rtx x;
basic_block bb;
{ {
int i, j; int i, j;
enum rtx_code code; enum rtx_code code;
...@@ -3162,9 +3063,8 @@ expr_killed_p (x, bb) ...@@ -3162,9 +3063,8 @@ expr_killed_p (x, bb)
/* Compute the set of available expressions killed in each basic block. */ /* Compute the set of available expressions killed in each basic block. */
static void static void
compute_ae_kill (ae_gen, ae_kill, expr_hash_table) compute_ae_kill (sbitmap *ae_gen, sbitmap *ae_kill,
sbitmap *ae_gen, *ae_kill; struct hash_table *expr_hash_table)
struct hash_table *expr_hash_table;
{ {
basic_block bb; basic_block bb;
unsigned int i; unsigned int i;
...@@ -3202,12 +3102,8 @@ compute_ae_kill (ae_gen, ae_kill, expr_hash_table) ...@@ -3202,12 +3102,8 @@ compute_ae_kill (ae_gen, ae_kill, expr_hash_table)
the closest such expression. */ the closest such expression. */
static int static int
expr_reaches_here_p_work (occr, expr, bb, check_self_loop, visited) expr_reaches_here_p_work (struct occr *occr, struct expr *expr,
struct occr *occr; basic_block bb, int check_self_loop, char *visited)
struct expr *expr;
basic_block bb;
int check_self_loop;
char *visited;
{ {
edge pred; edge pred;
...@@ -3264,11 +3160,8 @@ expr_reaches_here_p_work (occr, expr, bb, check_self_loop, visited) ...@@ -3264,11 +3160,8 @@ expr_reaches_here_p_work (occr, expr, bb, check_self_loop, visited)
memory allocated for that function is returned. */ memory allocated for that function is returned. */
static int static int
expr_reaches_here_p (occr, expr, bb, check_self_loop) expr_reaches_here_p (struct occr *occr, struct expr *expr, basic_block bb,
struct occr *occr; int check_self_loop)
struct expr *expr;
basic_block bb;
int check_self_loop;
{ {
int rval; int rval;
char *visited = (char *) xcalloc (last_basic_block, 1); char *visited = (char *) xcalloc (last_basic_block, 1);
...@@ -3285,9 +3178,7 @@ expr_reaches_here_p (occr, expr, bb, check_self_loop) ...@@ -3285,9 +3178,7 @@ expr_reaches_here_p (occr, expr, bb, check_self_loop)
Called only by handle_avail_expr. */ Called only by handle_avail_expr. */
static rtx static rtx
computing_insn (expr, insn) computing_insn (struct expr *expr, rtx insn)
struct expr *expr;
rtx insn;
{ {
basic_block bb = BLOCK_FOR_INSN (insn); basic_block bb = BLOCK_FOR_INSN (insn);
...@@ -3350,8 +3241,7 @@ computing_insn (expr, insn) ...@@ -3350,8 +3241,7 @@ computing_insn (expr, insn)
Only called by can_disregard_other_sets. */ Only called by can_disregard_other_sets. */
static int static int
def_reaches_here_p (insn, def_insn) def_reaches_here_p (rtx insn, rtx def_insn)
rtx insn, def_insn;
{ {
rtx reg; rtx reg;
...@@ -3387,10 +3277,7 @@ def_reaches_here_p (insn, def_insn) ...@@ -3387,10 +3277,7 @@ def_reaches_here_p (insn, def_insn)
always safe to return zero. */ always safe to return zero. */
static int static int
can_disregard_other_sets (addr_this_reg, insn, for_combine) can_disregard_other_sets (struct reg_set **addr_this_reg, rtx insn, int for_combine)
struct reg_set **addr_this_reg;
rtx insn;
int for_combine;
{ {
int number_of_reaching_defs = 0; int number_of_reaching_defs = 0;
struct reg_set *this_reg; struct reg_set *this_reg;
...@@ -3435,9 +3322,7 @@ can_disregard_other_sets (addr_this_reg, insn, for_combine) ...@@ -3435,9 +3322,7 @@ can_disregard_other_sets (addr_this_reg, insn, for_combine)
The result is nonzero if any changes were made. */ The result is nonzero if any changes were made. */
static int static int
handle_avail_expr (insn, expr) handle_avail_expr (rtx insn, struct expr *expr)
rtx insn;
struct expr *expr;
{ {
rtx pat, insn_computes_expr, expr_set; rtx pat, insn_computes_expr, expr_set;
rtx to; rtx to;
...@@ -3593,7 +3478,7 @@ handle_avail_expr (insn, expr) ...@@ -3593,7 +3478,7 @@ handle_avail_expr (insn, expr)
The result is nonzero if a change was made. */ The result is nonzero if a change was made. */
static int static int
classic_gcse () classic_gcse (void)
{ {
int changed; int changed;
rtx insn; rtx insn;
...@@ -3652,8 +3537,7 @@ classic_gcse () ...@@ -3652,8 +3537,7 @@ classic_gcse ()
Return nonzero if a change was made. */ Return nonzero if a change was made. */
static int static int
one_classic_gcse_pass (pass) one_classic_gcse_pass (int pass)
int pass;
{ {
int changed = 0; int changed = 0;
...@@ -3706,8 +3590,7 @@ static sbitmap *cprop_avout; ...@@ -3706,8 +3590,7 @@ static sbitmap *cprop_avout;
basic blocks. N_SETS is the number of sets. */ basic blocks. N_SETS is the number of sets. */
static void static void
alloc_cprop_mem (n_blocks, n_sets) alloc_cprop_mem (int n_blocks, int n_sets)
int n_blocks, n_sets;
{ {
cprop_pavloc = sbitmap_vector_alloc (n_blocks, n_sets); cprop_pavloc = sbitmap_vector_alloc (n_blocks, n_sets);
cprop_absaltered = sbitmap_vector_alloc (n_blocks, n_sets); cprop_absaltered = sbitmap_vector_alloc (n_blocks, n_sets);
...@@ -3719,7 +3602,7 @@ alloc_cprop_mem (n_blocks, n_sets) ...@@ -3719,7 +3602,7 @@ alloc_cprop_mem (n_blocks, n_sets)
/* Free vars used by copy/const propagation. */ /* Free vars used by copy/const propagation. */
static void static void
free_cprop_mem () free_cprop_mem (void)
{ {
sbitmap_vector_free (cprop_pavloc); sbitmap_vector_free (cprop_pavloc);
sbitmap_vector_free (cprop_absaltered); sbitmap_vector_free (cprop_absaltered);
...@@ -3734,11 +3617,7 @@ free_cprop_mem () ...@@ -3734,11 +3617,7 @@ free_cprop_mem ()
bit in BMAP. */ bit in BMAP. */
static void static void
compute_transp (x, indx, bmap, set_p) compute_transp (rtx x, int indx, sbitmap *bmap, int set_p)
rtx x;
int indx;
sbitmap *bmap;
int set_p;
{ {
int i, j; int i, j;
basic_block bb; basic_block bb;
...@@ -3869,7 +3748,7 @@ compute_transp (x, indx, bmap, set_p) ...@@ -3869,7 +3748,7 @@ compute_transp (x, indx, bmap, set_p)
propagation. */ propagation. */
static void static void
compute_cprop_data () compute_cprop_data (void)
{ {
compute_local_properties (cprop_absaltered, cprop_pavloc, NULL, &set_hash_table); compute_local_properties (cprop_absaltered, cprop_pavloc, NULL, &set_hash_table);
compute_available (cprop_pavloc, cprop_absaltered, compute_available (cprop_pavloc, cprop_absaltered,
...@@ -3896,9 +3775,7 @@ static int reg_use_count; ...@@ -3896,9 +3775,7 @@ static int reg_use_count;
This doesn't hurt anything but it will slow things down. */ This doesn't hurt anything but it will slow things down. */
static void static void
find_used_regs (xptr, data) find_used_regs (rtx *xptr, void *data ATTRIBUTE_UNUSED)
rtx *xptr;
void *data ATTRIBUTE_UNUSED;
{ {
int i, j; int i, j;
enum rtx_code code; enum rtx_code code;
...@@ -3948,8 +3825,7 @@ find_used_regs (xptr, data) ...@@ -3948,8 +3825,7 @@ find_used_regs (xptr, data)
Returns nonzero is successful. */ Returns nonzero is successful. */
static int static int
try_replace_reg (from, to, insn) try_replace_reg (rtx from, rtx to, rtx insn)
rtx from, to, insn;
{ {
rtx note = find_reg_equal_equiv_note (insn); rtx note = find_reg_equal_equiv_note (insn);
rtx src = 0; rtx src = 0;
...@@ -4005,9 +3881,7 @@ try_replace_reg (from, to, insn) ...@@ -4005,9 +3881,7 @@ try_replace_reg (from, to, insn)
NULL no such set is found. */ NULL no such set is found. */
static struct expr * static struct expr *
find_avail_set (regno, insn) find_avail_set (int regno, rtx insn)
int regno;
rtx insn;
{ {
/* SET1 contains the last set found that can be returned to the caller for /* SET1 contains the last set found that can be returned to the caller for
use in a substitution. */ use in a substitution. */
...@@ -4079,12 +3953,7 @@ find_avail_set (regno, insn) ...@@ -4079,12 +3953,7 @@ find_avail_set (regno, insn)
if a change was made. */ if a change was made. */
static int static int
cprop_jump (bb, setcc, jump, from, src) cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src)
basic_block bb;
rtx setcc;
rtx jump;
rtx from;
rtx src;
{ {
rtx new, set_src, note_src; rtx new, set_src, note_src;
rtx set = pc_set (jump); rtx set = pc_set (jump);
...@@ -4183,11 +4052,7 @@ cprop_jump (bb, setcc, jump, from, src) ...@@ -4183,11 +4052,7 @@ cprop_jump (bb, setcc, jump, from, src)
} }
static bool static bool
constprop_register (insn, from, to, alter_jumps) constprop_register (rtx insn, rtx from, rtx to, int alter_jumps)
rtx insn;
rtx from;
rtx to;
int alter_jumps;
{ {
rtx sset; rtx sset;
...@@ -4224,9 +4089,7 @@ constprop_register (insn, from, to, alter_jumps) ...@@ -4224,9 +4089,7 @@ constprop_register (insn, from, to, alter_jumps)
The result is nonzero if a change was made. */ The result is nonzero if a change was made. */
static int static int
cprop_insn (insn, alter_jumps) cprop_insn (rtx insn, int alter_jumps)
rtx insn;
int alter_jumps;
{ {
struct reg_use *reg_used; struct reg_use *reg_used;
int changed = 0; int changed = 0;
...@@ -4325,9 +4188,7 @@ cprop_insn (insn, alter_jumps) ...@@ -4325,9 +4188,7 @@ cprop_insn (insn, alter_jumps)
can legitimately make replacements. */ can legitimately make replacements. */
static void static void
local_cprop_find_used_regs (xptr, data) local_cprop_find_used_regs (rtx *xptr, void *data)
rtx *xptr;
void *data;
{ {
rtx x = *xptr; rtx x = *xptr;
...@@ -4365,16 +4226,12 @@ local_cprop_find_used_regs (xptr, data) ...@@ -4365,16 +4226,12 @@ local_cprop_find_used_regs (xptr, data)
find_used_regs (xptr, data); find_used_regs (xptr, data);
} }
/* LIBCALL_SP is a zero-terminated array of insns at the end of a libcall; /* LIBCALL_SP is a zero-terminated array of insns at the end of a libcall;
their REG_EQUAL notes need updating. */ their REG_EQUAL notes need updating. */
static bool static bool
do_local_cprop (x, insn, alter_jumps, libcall_sp) do_local_cprop (rtx x, rtx insn, int alter_jumps, rtx *libcall_sp)
rtx x;
rtx insn;
int alter_jumps;
rtx *libcall_sp;
{ {
rtx newreg = NULL, newcnst = NULL; rtx newreg = NULL, newcnst = NULL;
...@@ -4453,8 +4310,7 @@ do_local_cprop (x, insn, alter_jumps, libcall_sp) ...@@ -4453,8 +4310,7 @@ do_local_cprop (x, insn, alter_jumps, libcall_sp)
replaced with NEWVAL in INSN. Return true if all substitutions could replaced with NEWVAL in INSN. Return true if all substitutions could
be made. */ be made. */
static bool static bool
adjust_libcall_notes (oldreg, newval, insn, libcall_sp) adjust_libcall_notes (rtx oldreg, rtx newval, rtx insn, rtx *libcall_sp)
rtx oldreg, newval, insn, *libcall_sp;
{ {
rtx end; rtx end;
...@@ -4490,8 +4346,7 @@ adjust_libcall_notes (oldreg, newval, insn, libcall_sp) ...@@ -4490,8 +4346,7 @@ adjust_libcall_notes (oldreg, newval, insn, libcall_sp)
#define MAX_NESTED_LIBCALLS 9 #define MAX_NESTED_LIBCALLS 9
static void static void
local_cprop_pass (alter_jumps) local_cprop_pass (int alter_jumps)
int alter_jumps;
{ {
rtx insn; rtx insn;
struct reg_use *reg_used; struct reg_use *reg_used;
...@@ -4554,8 +4409,7 @@ local_cprop_pass (alter_jumps) ...@@ -4554,8 +4409,7 @@ local_cprop_pass (alter_jumps)
nonzero if a change was made. */ nonzero if a change was made. */
static int static int
cprop (alter_jumps) cprop (int alter_jumps)
int alter_jumps;
{ {
int changed; int changed;
basic_block bb; basic_block bb;
...@@ -4608,8 +4462,7 @@ cprop (alter_jumps) ...@@ -4608,8 +4462,7 @@ cprop (alter_jumps)
but this would require some code reorganization. */ but this would require some code reorganization. */
rtx rtx
fis_get_condition (jump) fis_get_condition (rtx jump)
rtx jump;
{ {
rtx cond, set, tmp, insn, earliest; rtx cond, set, tmp, insn, earliest;
bool reverse; bool reverse;
...@@ -4665,7 +4518,7 @@ fis_get_condition (jump) ...@@ -4665,7 +4518,7 @@ fis_get_condition (jump)
basic block. */ basic block. */
static void static void
find_implicit_sets () find_implicit_sets (void)
{ {
basic_block bb, dest; basic_block bb, dest;
unsigned int count; unsigned int count;
...@@ -4714,10 +4567,7 @@ find_implicit_sets () ...@@ -4714,10 +4567,7 @@ find_implicit_sets ()
perform conditional jump bypassing optimizations. */ perform conditional jump bypassing optimizations. */
static int static int
one_cprop_pass (pass, cprop_jumps, bypass_jumps) one_cprop_pass (int pass, int cprop_jumps, int bypass_jumps)
int pass;
int cprop_jumps;
int bypass_jumps;
{ {
int changed = 0; int changed = 0;
...@@ -4779,9 +4629,7 @@ static int bypass_last_basic_block; ...@@ -4779,9 +4629,7 @@ static int bypass_last_basic_block;
find_avail_set. */ find_avail_set. */
static struct expr * static struct expr *
find_bypass_set (regno, bb) find_bypass_set (int regno, int bb)
int regno;
int bb;
{ {
struct expr *result = 0; struct expr *result = 0;
...@@ -4823,9 +4671,7 @@ find_bypass_set (regno, bb) ...@@ -4823,9 +4671,7 @@ find_bypass_set (regno, bb)
valid prior to commit_edge_insertions. */ valid prior to commit_edge_insertions. */
static bool static bool
reg_killed_on_edge (reg, e) reg_killed_on_edge (rtx reg, edge e)
rtx reg;
edge e;
{ {
rtx insn; rtx insn;
...@@ -4847,9 +4693,7 @@ reg_killed_on_edge (reg, e) ...@@ -4847,9 +4693,7 @@ reg_killed_on_edge (reg, e)
these inserted insns when performing its transformations. */ these inserted insns when performing its transformations. */
static int static int
bypass_block (bb, setcc, jump) bypass_block (basic_block bb, rtx setcc, rtx jump)
basic_block bb;
rtx setcc, jump;
{ {
rtx insn, note; rtx insn, note;
edge e, enext, edest; edge e, enext, edest;
...@@ -4921,7 +4765,7 @@ bypass_block (bb, setcc, jump) ...@@ -4921,7 +4765,7 @@ bypass_block (bb, setcc, jump)
new = simplify_replace_rtx (src, reg_used->reg_rtx, new = simplify_replace_rtx (src, reg_used->reg_rtx,
SET_SRC (set->expr)); SET_SRC (set->expr));
/* Jump bypassing may have already placed instructions on /* Jump bypassing may have already placed instructions on
edges of the CFG. We can't bypass an outgoing edge that edges of the CFG. We can't bypass an outgoing edge that
has instructions associated with it, as these insns won't has instructions associated with it, as these insns won't
get executed if the incoming edge is redirected. */ get executed if the incoming edge is redirected. */
...@@ -4985,7 +4829,7 @@ bypass_block (bb, setcc, jump) ...@@ -4985,7 +4829,7 @@ bypass_block (bb, setcc, jump)
This function is now mis-named, because we also handle indirect jumps. */ This function is now mis-named, because we also handle indirect jumps. */
static int static int
bypass_conditional_jumps () bypass_conditional_jumps (void)
{ {
basic_block bb; basic_block bb;
int changed; int changed;
...@@ -5083,8 +4927,7 @@ static sbitmap pre_redundant_insns; ...@@ -5083,8 +4927,7 @@ static sbitmap pre_redundant_insns;
/* Allocate vars used for PRE analysis. */ /* Allocate vars used for PRE analysis. */
static void static void
alloc_pre_mem (n_blocks, n_exprs) alloc_pre_mem (int n_blocks, int n_exprs)
int n_blocks, n_exprs;
{ {
transp = sbitmap_vector_alloc (n_blocks, n_exprs); transp = sbitmap_vector_alloc (n_blocks, n_exprs);
comp = sbitmap_vector_alloc (n_blocks, n_exprs); comp = sbitmap_vector_alloc (n_blocks, n_exprs);
...@@ -5104,7 +4947,7 @@ alloc_pre_mem (n_blocks, n_exprs) ...@@ -5104,7 +4947,7 @@ alloc_pre_mem (n_blocks, n_exprs)
/* Free vars used for PRE analysis. */ /* Free vars used for PRE analysis. */
static void static void
free_pre_mem () free_pre_mem (void)
{ {
sbitmap_vector_free (transp); sbitmap_vector_free (transp);
sbitmap_vector_free (comp); sbitmap_vector_free (comp);
...@@ -5132,7 +4975,7 @@ free_pre_mem () ...@@ -5132,7 +4975,7 @@ free_pre_mem ()
/* Top level routine to do the dataflow analysis needed by PRE. */ /* Top level routine to do the dataflow analysis needed by PRE. */
static void static void
compute_pre_data () compute_pre_data (void)
{ {
sbitmap trapping_expr; sbitmap trapping_expr;
basic_block bb; basic_block bb;
...@@ -5203,11 +5046,7 @@ compute_pre_data () ...@@ -5203,11 +5046,7 @@ compute_pre_data ()
the closest such expression. */ the closest such expression. */
static int static int
pre_expr_reaches_here_p_work (occr_bb, expr, bb, visited) pre_expr_reaches_here_p_work (basic_block occr_bb, struct expr *expr, basic_block bb, char *visited)
basic_block occr_bb;
struct expr *expr;
basic_block bb;
char *visited;
{ {
edge pred; edge pred;
...@@ -5252,10 +5091,7 @@ pre_expr_reaches_here_p_work (occr_bb, expr, bb, visited) ...@@ -5252,10 +5091,7 @@ pre_expr_reaches_here_p_work (occr_bb, expr, bb, visited)
memory allocated for that function is returned. */ memory allocated for that function is returned. */
static int static int
pre_expr_reaches_here_p (occr_bb, expr, bb) pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb)
basic_block occr_bb;
struct expr *expr;
basic_block bb;
{ {
int rval; int rval;
char *visited = (char *) xcalloc (last_basic_block, 1); char *visited = (char *) xcalloc (last_basic_block, 1);
...@@ -5272,8 +5108,7 @@ pre_expr_reaches_here_p (occr_bb, expr, bb) ...@@ -5272,8 +5108,7 @@ pre_expr_reaches_here_p (occr_bb, expr, bb)
the value of BB. */ the value of BB. */
static rtx static rtx
process_insert_insn (expr) process_insert_insn (struct expr *expr)
struct expr *expr;
{ {
rtx reg = expr->reaching_reg; rtx reg = expr->reaching_reg;
rtx exp = copy_rtx (expr->expr); rtx exp = copy_rtx (expr->expr);
...@@ -5307,10 +5142,7 @@ process_insert_insn (expr) ...@@ -5307,10 +5142,7 @@ process_insert_insn (expr)
no sense for code hoisting. */ no sense for code hoisting. */
static void static void
insert_insn_end_bb (expr, bb, pre) insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
struct expr *expr;
basic_block bb;
int pre;
{ {
rtx insn = bb->end; rtx insn = bb->end;
rtx new_insn; rtx new_insn;
...@@ -5439,9 +5271,7 @@ insert_insn_end_bb (expr, bb, pre) ...@@ -5439,9 +5271,7 @@ insert_insn_end_bb (expr, bb, pre)
the expressions fully redundant. */ the expressions fully redundant. */
static int static int
pre_edge_insert (edge_list, index_map) pre_edge_insert (struct edge_list *edge_list, struct expr **index_map)
struct edge_list *edge_list;
struct expr **index_map;
{ {
int e, i, j, num_edges, set_size, did_insert = 0; int e, i, j, num_edges, set_size, did_insert = 0;
sbitmap *inserted; sbitmap *inserted;
...@@ -5523,9 +5353,7 @@ pre_edge_insert (edge_list, index_map) ...@@ -5523,9 +5353,7 @@ pre_edge_insert (edge_list, index_map)
/* Copy the result of INSN to REG. INDX is the expression number. */ /* Copy the result of INSN to REG. INDX is the expression number. */
static void static void
pre_insert_copy_insn (expr, insn) pre_insert_copy_insn (struct expr *expr, rtx insn)
struct expr *expr;
rtx insn;
{ {
rtx reg = expr->reaching_reg; rtx reg = expr->reaching_reg;
int regno = REGNO (reg); int regno = REGNO (reg);
...@@ -5555,7 +5383,7 @@ pre_insert_copy_insn (expr, insn) ...@@ -5555,7 +5383,7 @@ pre_insert_copy_insn (expr, insn)
to `reaching_reg'. */ to `reaching_reg'. */
static void static void
pre_insert_copies () pre_insert_copies (void)
{ {
unsigned int i; unsigned int i;
struct expr *expr; struct expr *expr;
...@@ -5613,8 +5441,7 @@ pre_insert_copies () ...@@ -5613,8 +5441,7 @@ pre_insert_copies ()
/* Emit move from SRC to DEST noting the equivalence with expression computed /* Emit move from SRC to DEST noting the equivalence with expression computed
in INSN. */ in INSN. */
static rtx static rtx
gcse_emit_move_after (src, dest, insn) gcse_emit_move_after (rtx src, rtx dest, rtx insn)
rtx src, dest, insn;
{ {
rtx new; rtx new;
rtx set = single_set (insn), set2; rtx set = single_set (insn), set2;
...@@ -5648,7 +5475,7 @@ gcse_emit_move_after (src, dest, insn) ...@@ -5648,7 +5475,7 @@ gcse_emit_move_after (src, dest, insn)
Returns nonzero if a change is made. */ Returns nonzero if a change is made. */
static int static int
pre_delete () pre_delete (void)
{ {
unsigned int i; unsigned int i;
int changed; int changed;
...@@ -5726,7 +5553,7 @@ pre_delete () ...@@ -5726,7 +5553,7 @@ pre_delete ()
redundancies. */ redundancies. */
static int static int
pre_gcse () pre_gcse (void)
{ {
unsigned int i; unsigned int i;
int did_insert, changed; int did_insert, changed;
...@@ -5773,8 +5600,7 @@ pre_gcse () ...@@ -5773,8 +5600,7 @@ pre_gcse ()
Return nonzero if a change was made. */ Return nonzero if a change was made. */
static int static int
one_pre_gcse_pass (pass) one_pre_gcse_pass (int pass)
int pass;
{ {
int changed = 0; int changed = 0;
...@@ -5828,9 +5654,7 @@ one_pre_gcse_pass (pass) ...@@ -5828,9 +5654,7 @@ one_pre_gcse_pass (pass)
necessary REG_LABEL notes. */ necessary REG_LABEL notes. */
static void static void
add_label_notes (x, insn) add_label_notes (rtx x, rtx insn)
rtx x;
rtx insn;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
int i, j; int i, j;
...@@ -5875,7 +5699,7 @@ add_label_notes (x, insn) ...@@ -5875,7 +5699,7 @@ add_label_notes (x, insn)
EH table sizes, this may not be worthwhile. */ EH table sizes, this may not be worthwhile. */
static void static void
compute_transpout () compute_transpout (void)
{ {
basic_block bb; basic_block bb;
unsigned int i; unsigned int i;
...@@ -5916,10 +5740,7 @@ compute_transpout () ...@@ -5916,10 +5740,7 @@ compute_transpout ()
We ignore hard registers. */ We ignore hard registers. */
static void static void
invalidate_nonnull_info (x, setter, data) invalidate_nonnull_info (rtx x, rtx setter ATTRIBUTE_UNUSED, void *data)
rtx x;
rtx setter ATTRIBUTE_UNUSED;
void *data;
{ {
unsigned int regno; unsigned int regno;
struct null_pointer_info *npi = (struct null_pointer_info *) data; struct null_pointer_info *npi = (struct null_pointer_info *) data;
...@@ -5944,12 +5765,9 @@ invalidate_nonnull_info (x, setter, data) ...@@ -5944,12 +5765,9 @@ invalidate_nonnull_info (x, setter, data)
they are not our responsibility to free. */ they are not our responsibility to free. */
static int static int
delete_null_pointer_checks_1 (block_reg, nonnull_avin, delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin,
nonnull_avout, npi) sbitmap *nonnull_avout,
unsigned int *block_reg; struct null_pointer_info *npi)
sbitmap *nonnull_avin;
sbitmap *nonnull_avout;
struct null_pointer_info *npi;
{ {
basic_block bb, current_block; basic_block bb, current_block;
sbitmap *nonnull_local = npi->nonnull_local; sbitmap *nonnull_local = npi->nonnull_local;
...@@ -6116,8 +5934,7 @@ delete_null_pointer_checks_1 (block_reg, nonnull_avin, ...@@ -6116,8 +5934,7 @@ delete_null_pointer_checks_1 (block_reg, nonnull_avin,
This could probably be integrated with global cprop with a little work. */ This could probably be integrated with global cprop with a little work. */
int int
delete_null_pointer_checks (f) delete_null_pointer_checks (rtx f ATTRIBUTE_UNUSED)
rtx f ATTRIBUTE_UNUSED;
{ {
sbitmap *nonnull_avin, *nonnull_avout; sbitmap *nonnull_avin, *nonnull_avout;
unsigned int *block_reg; unsigned int *block_reg;
...@@ -6234,8 +6051,7 @@ dominance_info dominators; ...@@ -6234,8 +6051,7 @@ dominance_info dominators;
/* Allocate vars used for code hoisting analysis. */ /* Allocate vars used for code hoisting analysis. */
static void static void
alloc_code_hoist_mem (n_blocks, n_exprs) alloc_code_hoist_mem (int n_blocks, int n_exprs)
int n_blocks, n_exprs;
{ {
antloc = sbitmap_vector_alloc (n_blocks, n_exprs); antloc = sbitmap_vector_alloc (n_blocks, n_exprs);
transp = sbitmap_vector_alloc (n_blocks, n_exprs); transp = sbitmap_vector_alloc (n_blocks, n_exprs);
...@@ -6250,7 +6066,7 @@ alloc_code_hoist_mem (n_blocks, n_exprs) ...@@ -6250,7 +6066,7 @@ alloc_code_hoist_mem (n_blocks, n_exprs)
/* Free vars used for code hoisting analysis. */ /* Free vars used for code hoisting analysis. */
static void static void
free_code_hoist_mem () free_code_hoist_mem (void)
{ {
sbitmap_vector_free (antloc); sbitmap_vector_free (antloc);
sbitmap_vector_free (transp); sbitmap_vector_free (transp);
...@@ -6270,7 +6086,7 @@ free_code_hoist_mem () ...@@ -6270,7 +6086,7 @@ free_code_hoist_mem ()
compute the expression. */ compute the expression. */
static void static void
compute_code_hoist_vbeinout () compute_code_hoist_vbeinout (void)
{ {
int changed, passes; int changed, passes;
basic_block bb; basic_block bb;
...@@ -6305,7 +6121,7 @@ compute_code_hoist_vbeinout () ...@@ -6305,7 +6121,7 @@ compute_code_hoist_vbeinout ()
/* Top level routine to do the dataflow analysis needed by code hoisting. */ /* Top level routine to do the dataflow analysis needed by code hoisting. */
static void static void
compute_code_hoist_data () compute_code_hoist_data (void)
{ {
compute_local_properties (transp, comp, antloc, &expr_hash_table); compute_local_properties (transp, comp, antloc, &expr_hash_table);
compute_transpout (); compute_transpout ();
...@@ -6329,11 +6145,7 @@ compute_code_hoist_data () ...@@ -6329,11 +6145,7 @@ compute_code_hoist_data ()
paths. */ paths. */
static int static int
hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited) hoist_expr_reaches_here_p (basic_block expr_bb, int expr_index, basic_block bb, char *visited)
basic_block expr_bb;
int expr_index;
basic_block bb;
char *visited;
{ {
edge pred; edge pred;
int visited_allocated_locally = 0; int visited_allocated_locally = 0;
...@@ -6380,7 +6192,7 @@ hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited) ...@@ -6380,7 +6192,7 @@ hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited)
/* Actually perform code hoisting. */ /* Actually perform code hoisting. */
static void static void
hoist_code () hoist_code (void)
{ {
basic_block bb, dominated; basic_block bb, dominated;
basic_block *domby; basic_block *domby;
...@@ -6460,7 +6272,7 @@ hoist_code () ...@@ -6460,7 +6272,7 @@ hoist_code ()
/* If we found nothing to hoist, then quit now. */ /* If we found nothing to hoist, then quit now. */
if (! found) if (! found)
{ {
free (domby); free (domby);
continue; continue;
} }
...@@ -6546,7 +6358,7 @@ hoist_code () ...@@ -6546,7 +6358,7 @@ hoist_code ()
Return nonzero if a change was made. */ Return nonzero if a change was made. */
static int static int
one_code_hoisting_pass () one_code_hoisting_pass (void)
{ {
int changed = 0; int changed = 0;
...@@ -6597,8 +6409,7 @@ one_code_hoisting_pass () ...@@ -6597,8 +6409,7 @@ one_code_hoisting_pass ()
doesn't find one, we create one and initialize it. */ doesn't find one, we create one and initialize it. */
static struct ls_expr * static struct ls_expr *
ldst_entry (x) ldst_entry (rtx x)
rtx x;
{ {
struct ls_expr * ptr; struct ls_expr * ptr;
...@@ -6629,8 +6440,7 @@ ldst_entry (x) ...@@ -6629,8 +6440,7 @@ ldst_entry (x)
/* Free up an individual ldst entry. */ /* Free up an individual ldst entry. */
static void static void
free_ldst_entry (ptr) free_ldst_entry (struct ls_expr * ptr)
struct ls_expr * ptr;
{ {
free_INSN_LIST_list (& ptr->loads); free_INSN_LIST_list (& ptr->loads);
free_INSN_LIST_list (& ptr->stores); free_INSN_LIST_list (& ptr->stores);
...@@ -6641,7 +6451,7 @@ free_ldst_entry (ptr) ...@@ -6641,7 +6451,7 @@ free_ldst_entry (ptr)
/* Free up all memory associated with the ldst list. */ /* Free up all memory associated with the ldst list. */
static void static void
free_ldst_mems () free_ldst_mems (void)
{ {
while (pre_ldst_mems) while (pre_ldst_mems)
{ {
...@@ -6658,8 +6468,7 @@ free_ldst_mems () ...@@ -6658,8 +6468,7 @@ free_ldst_mems ()
/* Dump debugging info about the ldst list. */ /* Dump debugging info about the ldst list. */
static void static void
print_ldst_list (file) print_ldst_list (FILE * file)
FILE * file;
{ {
struct ls_expr * ptr; struct ls_expr * ptr;
...@@ -6694,8 +6503,7 @@ print_ldst_list (file) ...@@ -6694,8 +6503,7 @@ print_ldst_list (file)
/* Returns 1 if X is in the list of ldst only expressions. */ /* Returns 1 if X is in the list of ldst only expressions. */
static struct ls_expr * static struct ls_expr *
find_rtx_in_ldst (x) find_rtx_in_ldst (rtx x)
rtx x;
{ {
struct ls_expr * ptr; struct ls_expr * ptr;
...@@ -6709,7 +6517,7 @@ find_rtx_in_ldst (x) ...@@ -6709,7 +6517,7 @@ find_rtx_in_ldst (x)
/* Assign each element of the list of mems a monotonically increasing value. */ /* Assign each element of the list of mems a monotonically increasing value. */
static int static int
enumerate_ldsts () enumerate_ldsts (void)
{ {
struct ls_expr * ptr; struct ls_expr * ptr;
int n = 0; int n = 0;
...@@ -6723,7 +6531,7 @@ enumerate_ldsts () ...@@ -6723,7 +6531,7 @@ enumerate_ldsts ()
/* Return first item in the list. */ /* Return first item in the list. */
static inline struct ls_expr * static inline struct ls_expr *
first_ls_expr () first_ls_expr (void)
{ {
return pre_ldst_mems; return pre_ldst_mems;
} }
...@@ -6731,8 +6539,7 @@ first_ls_expr () ...@@ -6731,8 +6539,7 @@ first_ls_expr ()
/* Return the next item in the list after the specified one. */ /* Return the next item in the list after the specified one. */
static inline struct ls_expr * static inline struct ls_expr *
next_ls_expr (ptr) next_ls_expr (struct ls_expr * ptr)
struct ls_expr * ptr;
{ {
return ptr->next; return ptr->next;
} }
...@@ -6744,8 +6551,7 @@ next_ls_expr (ptr) ...@@ -6744,8 +6551,7 @@ next_ls_expr (ptr)
ld_motion list, otherwise we let the usual aliasing take care of it. */ ld_motion list, otherwise we let the usual aliasing take care of it. */
static int static int
simple_mem (x) simple_mem (rtx x)
rtx x;
{ {
if (GET_CODE (x) != MEM) if (GET_CODE (x) != MEM)
return 0; return 0;
...@@ -6784,8 +6590,7 @@ simple_mem (x) ...@@ -6784,8 +6590,7 @@ simple_mem (x)
fix it up. */ fix it up. */
static void static void
invalidate_any_buried_refs (x) invalidate_any_buried_refs (rtx x)
rtx x;
{ {
const char * fmt; const char * fmt;
int i, j; int i, j;
...@@ -6820,7 +6625,7 @@ invalidate_any_buried_refs (x) ...@@ -6820,7 +6625,7 @@ invalidate_any_buried_refs (x)
later. */ later. */
static void static void
compute_ld_motion_mems () compute_ld_motion_mems (void)
{ {
struct ls_expr * ptr; struct ls_expr * ptr;
basic_block bb; basic_block bb;
...@@ -6885,7 +6690,7 @@ compute_ld_motion_mems () ...@@ -6885,7 +6690,7 @@ compute_ld_motion_mems ()
expression list for pre gcse. */ expression list for pre gcse. */
static void static void
trim_ld_motion_mems () trim_ld_motion_mems (void)
{ {
struct ls_expr * last = NULL; struct ls_expr * last = NULL;
struct ls_expr * ptr = first_ls_expr (); struct ls_expr * ptr = first_ls_expr ();
...@@ -6952,8 +6757,7 @@ trim_ld_motion_mems () ...@@ -6952,8 +6757,7 @@ trim_ld_motion_mems ()
correct value in the reaching register for the loads. */ correct value in the reaching register for the loads. */
static void static void
update_ld_motion_stores (expr) update_ld_motion_stores (struct expr * expr)
struct expr * expr;
{ {
struct ls_expr * mem_ptr; struct ls_expr * mem_ptr;
...@@ -7024,9 +6828,8 @@ static int num_stores; ...@@ -7024,9 +6828,8 @@ static int num_stores;
/* Checks to set if we need to mark a register set. Called from note_stores. */ /* Checks to set if we need to mark a register set. Called from note_stores. */
static void static void
reg_set_info (dest, setter, data) reg_set_info (rtx dest, rtx setter ATTRIBUTE_UNUSED,
rtx dest, setter ATTRIBUTE_UNUSED; void *data ATTRIBUTE_UNUSED)
void * data ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (dest) == SUBREG) if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest); dest = SUBREG_REG (dest);
...@@ -7037,11 +6840,9 @@ reg_set_info (dest, setter, data) ...@@ -7037,11 +6840,9 @@ reg_set_info (dest, setter, data)
/* Return zero if some of the registers in list X are killed /* Return zero if some of the registers in list X are killed
due to set of registers in bitmap REGS_SET. */ due to set of registers in bitmap REGS_SET. */
static bool static bool
store_ops_ok (x, regs_set) store_ops_ok (rtx x, int *regs_set)
rtx x;
int *regs_set;
{ {
rtx reg; rtx reg;
...@@ -7049,7 +6850,7 @@ store_ops_ok (x, regs_set) ...@@ -7049,7 +6850,7 @@ store_ops_ok (x, regs_set)
{ {
reg = XEXP (x, 0); reg = XEXP (x, 0);
if (regs_set[REGNO(reg)]) if (regs_set[REGNO(reg)])
return false; return false;
} }
return true; return true;
...@@ -7057,8 +6858,7 @@ store_ops_ok (x, regs_set) ...@@ -7057,8 +6858,7 @@ store_ops_ok (x, regs_set)
/* Returns a list of registers mentioned in X. */ /* Returns a list of registers mentioned in X. */
static rtx static rtx
extract_mentioned_regs (x) extract_mentioned_regs (rtx x)
rtx x;
{ {
return extract_mentioned_regs_helper (x, NULL_RTX); return extract_mentioned_regs_helper (x, NULL_RTX);
} }
...@@ -7066,9 +6866,7 @@ extract_mentioned_regs (x) ...@@ -7066,9 +6866,7 @@ extract_mentioned_regs (x)
/* Helper for extract_mentioned_regs; ACCUM is used to accumulate used /* Helper for extract_mentioned_regs; ACCUM is used to accumulate used
registers. */ registers. */
static rtx static rtx
extract_mentioned_regs_helper (x, accum) extract_mentioned_regs_helper (rtx x, rtx accum)
rtx x;
rtx accum;
{ {
int i; int i;
enum rtx_code code; enum rtx_code code;
...@@ -7149,7 +6947,7 @@ extract_mentioned_regs_helper (x, accum) ...@@ -7149,7 +6947,7 @@ extract_mentioned_regs_helper (x, accum)
current insn, REGS_SET_AFTER is bitmap of registers set after (and current insn, REGS_SET_AFTER is bitmap of registers set after (and
including) the insn in this basic block. We must be passing through BB from including) the insn in this basic block. We must be passing through BB from
head to end, as we are using this fact to speed things up. head to end, as we are using this fact to speed things up.
The results are stored this way: The results are stored this way:
-- the first anticipatable expression is added into ANTIC_STORE_LIST -- the first anticipatable expression is added into ANTIC_STORE_LIST
...@@ -7167,10 +6965,7 @@ extract_mentioned_regs_helper (x, accum) ...@@ -7167,10 +6965,7 @@ extract_mentioned_regs_helper (x, accum)
*/ */
static void static void
find_moveable_store (insn, regs_set_before, regs_set_after) find_moveable_store (rtx insn, int *regs_set_before, int *regs_set_after)
rtx insn;
int *regs_set_before;
int *regs_set_after;
{ {
struct ls_expr * ptr; struct ls_expr * ptr;
rtx dest, set, tmp; rtx dest, set, tmp;
...@@ -7195,7 +6990,7 @@ find_moveable_store (insn, regs_set_before, regs_set_after) ...@@ -7195,7 +6990,7 @@ find_moveable_store (insn, regs_set_before, regs_set_after)
continue. */ continue. */
if (flag_non_call_exceptions && may_trap_p (dest)) if (flag_non_call_exceptions && may_trap_p (dest))
return; return;
ptr = ldst_entry (dest); ptr = ldst_entry (dest);
if (!ptr->pattern_regs) if (!ptr->pattern_regs)
ptr->pattern_regs = extract_mentioned_regs (dest); ptr->pattern_regs = extract_mentioned_regs (dest);
...@@ -7255,11 +7050,11 @@ find_moveable_store (insn, regs_set_before, regs_set_after) ...@@ -7255,11 +7050,11 @@ find_moveable_store (insn, regs_set_before, regs_set_after)
if (!check_available) if (!check_available)
AVAIL_STORE_LIST (ptr) = alloc_INSN_LIST (insn, AVAIL_STORE_LIST (ptr)); AVAIL_STORE_LIST (ptr) = alloc_INSN_LIST (insn, AVAIL_STORE_LIST (ptr));
} }
/* Find available and anticipatable stores. */ /* Find available and anticipatable stores. */
static int static int
compute_store_table () compute_store_table (void)
{ {
int ret; int ret;
basic_block bb; basic_block bb;
...@@ -7394,8 +7189,7 @@ compute_store_table () ...@@ -7394,8 +7189,7 @@ compute_store_table ()
/* Check to see if the load X is aliased with STORE_PATTERN. */ /* Check to see if the load X is aliased with STORE_PATTERN. */
static bool static bool
load_kills_store (x, store_pattern) load_kills_store (rtx x, rtx store_pattern)
rtx x, store_pattern;
{ {
if (true_dependence (x, GET_MODE (x), store_pattern, rtx_addr_varies_p)) if (true_dependence (x, GET_MODE (x), store_pattern, rtx_addr_varies_p))
return true; return true;
...@@ -7406,8 +7200,7 @@ load_kills_store (x, store_pattern) ...@@ -7406,8 +7200,7 @@ load_kills_store (x, store_pattern)
STORE_PATTERN. Return true if found. */ STORE_PATTERN. Return true if found. */
static bool static bool
find_loads (x, store_pattern) find_loads (rtx x, rtx store_pattern)
rtx x, store_pattern;
{ {
const char * fmt; const char * fmt;
int i, j; int i, j;
...@@ -7443,8 +7236,7 @@ find_loads (x, store_pattern) ...@@ -7443,8 +7236,7 @@ find_loads (x, store_pattern)
Return true if it it does. */ Return true if it it does. */
static bool static bool
store_killed_in_insn (x, x_regs, insn) store_killed_in_insn (rtx x, rtx x_regs, rtx insn)
rtx x, x_regs, insn;
{ {
rtx reg, base; rtx reg, base;
...@@ -7493,16 +7285,13 @@ store_killed_in_insn (x, x_regs, insn) ...@@ -7493,16 +7285,13 @@ store_killed_in_insn (x, x_regs, insn)
is killed, return the last insn in that it occurs in FAIL_INSN. */ is killed, return the last insn in that it occurs in FAIL_INSN. */
static bool static bool
store_killed_after (x, x_regs, insn, bb, regs_set_after, fail_insn) store_killed_after (rtx x, rtx x_regs, rtx insn, basic_block bb,
rtx x, x_regs, insn; int *regs_set_after, rtx *fail_insn)
basic_block bb;
int *regs_set_after;
rtx *fail_insn;
{ {
rtx last = bb->end, act; rtx last = bb->end, act;
if (!store_ops_ok (x_regs, regs_set_after)) if (!store_ops_ok (x_regs, regs_set_after))
{ {
/* We do not know where it will happen. */ /* We do not know where it will happen. */
if (fail_insn) if (fail_insn)
*fail_insn = NULL_RTX; *fail_insn = NULL_RTX;
...@@ -7520,15 +7309,13 @@ store_killed_after (x, x_regs, insn, bb, regs_set_after, fail_insn) ...@@ -7520,15 +7309,13 @@ store_killed_after (x, x_regs, insn, bb, regs_set_after, fail_insn)
return false; return false;
} }
/* Returns true if the expression X is loaded or clobbered on or before INSN /* Returns true if the expression X is loaded or clobbered on or before INSN
within basic block BB. X_REGS is list of registers mentioned in X. within basic block BB. X_REGS is list of registers mentioned in X.
REGS_SET_BEFORE is bitmap of registers set before or in this insn. */ REGS_SET_BEFORE is bitmap of registers set before or in this insn. */
static bool static bool
store_killed_before (x, x_regs, insn, bb, regs_set_before) store_killed_before (rtx x, rtx x_regs, rtx insn, basic_block bb,
rtx x, x_regs, insn; int *regs_set_before)
basic_block bb;
int *regs_set_before;
{ {
rtx first = bb->head; rtx first = bb->head;
...@@ -7541,11 +7328,11 @@ store_killed_before (x, x_regs, insn, bb, regs_set_before) ...@@ -7541,11 +7328,11 @@ store_killed_before (x, x_regs, insn, bb, regs_set_before)
return false; return false;
} }
/* Fill in available, anticipatable, transparent and kill vectors in /* Fill in available, anticipatable, transparent and kill vectors in
STORE_DATA, based on lists of available and anticipatable stores. */ STORE_DATA, based on lists of available and anticipatable stores. */
static void static void
build_store_vectors () build_store_vectors (void)
{ {
basic_block bb; basic_block bb;
int *regs_set_in_block; int *regs_set_in_block;
...@@ -7613,10 +7400,10 @@ build_store_vectors () ...@@ -7613,10 +7400,10 @@ build_store_vectors ()
if (!TEST_BIT (st_antloc[bb->index], ptr->index) if (!TEST_BIT (st_antloc[bb->index], ptr->index)
|| !TEST_BIT (ae_gen[bb->index], ptr->index)) || !TEST_BIT (ae_gen[bb->index], ptr->index))
SET_BIT (ae_kill[bb->index], ptr->index); SET_BIT (ae_kill[bb->index], ptr->index);
} }
else else
SET_BIT (transp[bb->index], ptr->index); SET_BIT (transp[bb->index], ptr->index);
} }
} }
free (regs_set_in_block); free (regs_set_in_block);
...@@ -7634,9 +7421,7 @@ build_store_vectors () ...@@ -7634,9 +7421,7 @@ build_store_vectors ()
the BLOCK_HEAD if needed. */ the BLOCK_HEAD if needed. */
static void static void
insert_insn_start_bb (insn, bb) insert_insn_start_bb (rtx insn, basic_block bb)
rtx insn;
basic_block bb;
{ {
/* Insert at start of successor block. */ /* Insert at start of successor block. */
rtx prev = PREV_INSN (bb->head); rtx prev = PREV_INSN (bb->head);
...@@ -7669,9 +7454,7 @@ insert_insn_start_bb (insn, bb) ...@@ -7669,9 +7454,7 @@ insert_insn_start_bb (insn, bb)
if an edge insertion was performed. */ if an edge insertion was performed. */
static int static int
insert_store (expr, e) insert_store (struct ls_expr * expr, edge e)
struct ls_expr * expr;
edge e;
{ {
rtx reg, insn; rtx reg, insn;
basic_block bb; basic_block bb;
...@@ -7735,9 +7518,7 @@ insert_store (expr, e) ...@@ -7735,9 +7518,7 @@ insert_store (expr, e)
/* This routine will replace a store with a SET to a specified register. */ /* This routine will replace a store with a SET to a specified register. */
static void static void
replace_store_insn (reg, del, bb) replace_store_insn (rtx reg, rtx del, basic_block bb)
rtx reg, del;
basic_block bb;
{ {
rtx insn; rtx insn;
...@@ -7762,9 +7543,7 @@ replace_store_insn (reg, del, bb) ...@@ -7762,9 +7543,7 @@ replace_store_insn (reg, del, bb)
the reaching_reg for later storing. */ the reaching_reg for later storing. */
static void static void
delete_store (expr, bb) delete_store (struct ls_expr * expr, basic_block bb)
struct ls_expr * expr;
basic_block bb;
{ {
rtx reg, i, del; rtx reg, i, del;
...@@ -7789,7 +7568,7 @@ delete_store (expr, bb) ...@@ -7789,7 +7568,7 @@ delete_store (expr, bb)
/* Free memory used by store motion. */ /* Free memory used by store motion. */
static void static void
free_store_memory () free_store_memory (void)
{ {
free_ldst_mems (); free_ldst_mems ();
...@@ -7816,7 +7595,7 @@ free_store_memory () ...@@ -7816,7 +7595,7 @@ free_store_memory ()
other way by looking at the flowgraph in reverse. */ other way by looking at the flowgraph in reverse. */
static void static void
store_motion () store_motion (void)
{ {
basic_block bb; basic_block bb;
int x; int x;
...@@ -7873,8 +7652,7 @@ store_motion () ...@@ -7873,8 +7652,7 @@ store_motion ()
/* Entry point for jump bypassing optimization pass. */ /* Entry point for jump bypassing optimization pass. */
int int
bypass_jumps (file) bypass_jumps (FILE *file)
FILE *file;
{ {
int changed; int changed;
......
...@@ -219,8 +219,7 @@ extern void ggc_splay_dont_free (void *, void *); ...@@ -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. /* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS.
If LENGTH is -1, then CONTENTS is assumed to be a If LENGTH is -1, then CONTENTS is assumed to be a
null-terminated string and the memory sized accordingly. */ null-terminated string and the memory sized accordingly. */
extern const char *ggc_alloc_string PARAMS ((const char *contents, extern const char *ggc_alloc_string (const char *contents, int length);
int length));
/* Make a copy of S, in GC-able memory. */ /* Make a copy of S, in GC-able memory. */
#define ggc_strdup(S) ggc_alloc_string((S), -1) #define ggc_strdup(S) ggc_alloc_string((S), -1)
......
/* Allocate registers for pseudo-registers that span basic blocks. /* Allocate registers for pseudo-registers that span basic blocks.
Copyright (C) 1987, 1988, 1991, 1994, 1996, 1997, 1998, 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. This file is part of GCC.
...@@ -289,24 +289,23 @@ static int n_regs_set; ...@@ -289,24 +289,23 @@ static int n_regs_set;
static HARD_REG_SET eliminable_regset; static HARD_REG_SET eliminable_regset;
static int allocno_compare PARAMS ((const void *, const void *)); static int allocno_compare (const void *, const void *);
static void global_conflicts PARAMS ((void)); static void global_conflicts (void);
static void mirror_conflicts PARAMS ((void)); static void mirror_conflicts (void);
static void expand_preferences PARAMS ((void)); static void expand_preferences (void);
static void prune_preferences PARAMS ((void)); static void prune_preferences (void);
static void find_reg PARAMS ((int, HARD_REG_SET, int, int, int)); static void find_reg (int, HARD_REG_SET, int, int, int);
static void record_one_conflict PARAMS ((int)); static void record_one_conflict (int);
static void record_conflicts PARAMS ((int *, int)); static void record_conflicts (int *, int);
static void mark_reg_store PARAMS ((rtx, rtx, void *)); static void mark_reg_store (rtx, rtx, void *);
static void mark_reg_clobber PARAMS ((rtx, rtx, void *)); static void mark_reg_clobber (rtx, rtx, void *);
static void mark_reg_conflicts PARAMS ((rtx)); static void mark_reg_conflicts (rtx);
static void mark_reg_death PARAMS ((rtx)); static void mark_reg_death (rtx);
static void mark_reg_live_nc PARAMS ((int, enum machine_mode)); static void mark_reg_live_nc (int, enum machine_mode);
static void set_preference PARAMS ((rtx, rtx)); static void set_preference (rtx, rtx);
static void dump_conflicts PARAMS ((FILE *)); static void dump_conflicts (FILE *);
static void reg_becomes_live PARAMS ((rtx, rtx, void *)); static void reg_becomes_live (rtx, rtx, void *);
static void reg_dies PARAMS ((int, enum machine_mode, static void reg_dies (int, enum machine_mode, struct insn_chain *);
struct insn_chain *));
/* Perform allocation of pseudo-registers not allocated by local_alloc. /* Perform allocation of pseudo-registers not allocated by local_alloc.
FILE is a file to output debugging information on, FILE is a file to output debugging information on,
...@@ -316,8 +315,7 @@ static void reg_dies PARAMS ((int, enum machine_mode, ...@@ -316,8 +315,7 @@ static void reg_dies PARAMS ((int, enum machine_mode,
and we must not do any more for this function. */ and we must not do any more for this function. */
int int
global_alloc (file) global_alloc (FILE *file)
FILE *file;
{ {
int retval; int retval;
#ifdef ELIMINABLE_REGS #ifdef ELIMINABLE_REGS
...@@ -599,9 +597,7 @@ global_alloc (file) ...@@ -599,9 +597,7 @@ global_alloc (file)
Returns -1 (1) if *v1 should be allocated before (after) *v2. */ Returns -1 (1) if *v1 should be allocated before (after) *v2. */
static int static int
allocno_compare (v1p, v2p) allocno_compare (const void *v1p, const void *v2p)
const void *v1p;
const void *v2p;
{ {
int v1 = *(const int *)v1p, v2 = *(const int *)v2p; int v1 = *(const int *)v1p, v2 = *(const int *)v2p;
/* Note that the quotient will never be bigger than /* Note that the quotient will never be bigger than
...@@ -629,7 +625,7 @@ allocno_compare (v1p, v2p) ...@@ -629,7 +625,7 @@ allocno_compare (v1p, v2p)
conflict matrices and preference tables. */ conflict matrices and preference tables. */
static void static void
global_conflicts () global_conflicts (void)
{ {
int i; int i;
basic_block b; basic_block b;
...@@ -703,11 +699,11 @@ global_conflicts () ...@@ -703,11 +699,11 @@ global_conflicts ()
scan the instruction that makes either X or Y become live. */ scan the instruction that makes either X or Y become live. */
record_conflicts (block_start_allocnos, ax); record_conflicts (block_start_allocnos, ax);
/* Pseudos can't go in stack regs at the start of a basic block that /* 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, is reached by an abnormal edge. Likewise for call clobbered regs,
because because caller-save, fixup_abnormal_edges, and possibly because because caller-save, fixup_abnormal_edges, and possibly
the table driven EH machinery are not quite ready to handle such the table driven EH machinery are not quite ready to handle such
regs live across such edges. */ regs live across such edges. */
{ {
edge e; edge e;
...@@ -852,7 +848,7 @@ global_conflicts () ...@@ -852,7 +848,7 @@ global_conflicts ()
merge any preferences between those allocnos. */ merge any preferences between those allocnos. */
static void static void
expand_preferences () expand_preferences (void)
{ {
rtx insn; rtx insn;
rtx link; rtx link;
...@@ -903,7 +899,7 @@ expand_preferences () ...@@ -903,7 +899,7 @@ expand_preferences ()
we will avoid using these registers. */ we will avoid using these registers. */
static void static void
prune_preferences () prune_preferences (void)
{ {
int i; int i;
int num; int num;
...@@ -991,12 +987,7 @@ prune_preferences () ...@@ -991,12 +987,7 @@ prune_preferences ()
If not, do nothing. */ If not, do nothing. */
static void static void
find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying) find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbered, int retrying)
int num;
HARD_REG_SET losers;
int alt_regs_p;
int accept_call_clobbered;
int retrying;
{ {
int i, best_reg, pass; int i, best_reg, pass;
HARD_REG_SET used, used1, used2; HARD_REG_SET used, used1, used2;
...@@ -1110,7 +1101,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying) ...@@ -1110,7 +1101,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
(j < lim (j < lim
&& ! TEST_HARD_REG_BIT (used, j) && ! TEST_HARD_REG_BIT (used, j)
&& (REGNO_REG_CLASS (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), || reg_class_subset_p (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 (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) ...@@ -1149,7 +1140,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
(j < lim (j < lim
&& ! TEST_HARD_REG_BIT (used, j) && ! TEST_HARD_REG_BIT (used, j)
&& (REGNO_REG_CLASS (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), || reg_class_subset_p (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 (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) ...@@ -1311,9 +1302,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
If FORBIDDEN_REGS is zero, no regs are forbidden. */ If FORBIDDEN_REGS is zero, no regs are forbidden. */
void void
retry_global_alloc (regno, forbidden_regs) retry_global_alloc (int regno, HARD_REG_SET forbidden_regs)
int regno;
HARD_REG_SET forbidden_regs;
{ {
int alloc_no = reg_allocno[regno]; int alloc_no = reg_allocno[regno];
if (alloc_no >= 0) if (alloc_no >= 0)
...@@ -1344,8 +1333,7 @@ retry_global_alloc (regno, forbidden_regs) ...@@ -1344,8 +1333,7 @@ retry_global_alloc (regno, forbidden_regs)
reg_renumber before calling here. */ reg_renumber before calling here. */
static void static void
record_one_conflict (regno) record_one_conflict (int regno)
int regno;
{ {
int j; int j;
...@@ -1388,9 +1376,7 @@ record_one_conflict (regno) ...@@ -1388,9 +1376,7 @@ record_one_conflict (regno)
are currently live. Their bits are also flagged in allocnos_live. */ are currently live. Their bits are also flagged in allocnos_live. */
static void static void
record_conflicts (allocno_vec, len) record_conflicts (int *allocno_vec, int len)
int *allocno_vec;
int len;
{ {
while (--len >= 0) while (--len >= 0)
IOR_HARD_REG_SET (allocno[allocno_vec[len]].hard_reg_conflicts, IOR_HARD_REG_SET (allocno[allocno_vec[len]].hard_reg_conflicts,
...@@ -1399,7 +1385,7 @@ record_conflicts (allocno_vec, len) ...@@ -1399,7 +1385,7 @@ record_conflicts (allocno_vec, len)
/* If CONFLICTP (i, j) is true, make sure CONFLICTP (j, i) is also true. */ /* If CONFLICTP (i, j) is true, make sure CONFLICTP (j, i) is also true. */
static void static void
mirror_conflicts () mirror_conflicts (void)
{ {
int i, j; int i, j;
int rw = allocno_row_words; int rw = allocno_row_words;
...@@ -1447,9 +1433,7 @@ mirror_conflicts () ...@@ -1447,9 +1433,7 @@ mirror_conflicts ()
a REG_INC note was found for it). */ a REG_INC note was found for it). */
static void static void
mark_reg_store (reg, setter, data) mark_reg_store (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED)
rtx reg, setter;
void *data ATTRIBUTE_UNUSED;
{ {
int regno; int regno;
...@@ -1496,9 +1480,7 @@ mark_reg_store (reg, setter, data) ...@@ -1496,9 +1480,7 @@ mark_reg_store (reg, setter, data)
/* Like mark_reg_set except notice just CLOBBERs; ignore SETs. */ /* Like mark_reg_set except notice just CLOBBERs; ignore SETs. */
static void static void
mark_reg_clobber (reg, setter, data) mark_reg_clobber (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED)
rtx reg, setter;
void *data ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (setter) == CLOBBER) if (GET_CODE (setter) == CLOBBER)
mark_reg_store (reg, setter, data); mark_reg_store (reg, setter, data);
...@@ -1508,8 +1490,7 @@ mark_reg_clobber (reg, setter, data) ...@@ -1508,8 +1490,7 @@ mark_reg_clobber (reg, setter, data)
Do not mark REG itself as live. */ Do not mark REG itself as live. */
static void static void
mark_reg_conflicts (reg) mark_reg_conflicts (rtx reg)
rtx reg;
{ {
int regno; int regno;
...@@ -1548,8 +1529,7 @@ mark_reg_conflicts (reg) ...@@ -1548,8 +1529,7 @@ mark_reg_conflicts (reg)
Store a 0 in regs_live or allocnos_live for this register. */ Store a 0 in regs_live or allocnos_live for this register. */
static void static void
mark_reg_death (reg) mark_reg_death (rtx reg)
rtx reg;
{ {
int regno = REGNO (reg); int regno = REGNO (reg);
...@@ -1585,9 +1565,7 @@ mark_reg_death (reg) ...@@ -1585,9 +1565,7 @@ mark_reg_death (reg)
it is assumed that the caller will do that. */ it is assumed that the caller will do that. */
static void static void
mark_reg_live_nc (regno, mode) mark_reg_live_nc (int regno, enum machine_mode mode)
int regno;
enum machine_mode mode;
{ {
int last = regno + HARD_REGNO_NREGS (regno, mode); int last = regno + HARD_REGNO_NREGS (regno, mode);
while (regno < last) while (regno < last)
...@@ -1607,8 +1585,7 @@ mark_reg_live_nc (regno, mode) ...@@ -1607,8 +1585,7 @@ mark_reg_live_nc (regno, mode)
pseudo-register to a hard register. */ pseudo-register to a hard register. */
static void static void
set_preference (dest, src) set_preference (rtx dest, rtx src)
rtx dest, src;
{ {
unsigned int src_regno, dest_regno; unsigned int src_regno, dest_regno;
/* Amount to add to the hard regno for SRC, or subtract from that for DEST, /* Amount to add to the hard regno for SRC, or subtract from that for DEST,
...@@ -1715,8 +1692,7 @@ set_preference (dest, src) ...@@ -1715,8 +1692,7 @@ set_preference (dest, src)
a use of TO. */ a use of TO. */
void void
mark_elimination (from, to) mark_elimination (int from, int to)
int from, to;
{ {
basic_block bb; basic_block bb;
...@@ -1738,10 +1714,7 @@ static regset live_relevant_regs; ...@@ -1738,10 +1714,7 @@ static regset live_relevant_regs;
/* Record in live_relevant_regs and REGS_SET that register REG became live. /* Record in live_relevant_regs and REGS_SET that register REG became live.
This is called via note_stores. */ This is called via note_stores. */
static void static void
reg_becomes_live (reg, setter, regs_set) reg_becomes_live (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *regs_set)
rtx reg;
rtx setter ATTRIBUTE_UNUSED;
void *regs_set;
{ {
int regno; int regno;
...@@ -1772,10 +1745,7 @@ reg_becomes_live (reg, setter, regs_set) ...@@ -1772,10 +1745,7 @@ reg_becomes_live (reg, setter, regs_set)
/* Record in live_relevant_regs that register REGNO died. */ /* Record in live_relevant_regs that register REGNO died. */
static void static void
reg_dies (regno, mode, chain) reg_dies (int regno, enum machine_mode mode, struct insn_chain *chain)
int regno;
enum machine_mode mode;
struct insn_chain *chain;
{ {
if (regno < FIRST_PSEUDO_REGISTER) if (regno < FIRST_PSEUDO_REGISTER)
{ {
...@@ -1799,8 +1769,7 @@ reg_dies (regno, mode, chain) ...@@ -1799,8 +1769,7 @@ reg_dies (regno, mode, chain)
/* Walk the insns of the current function and build reload_insn_chain, /* Walk the insns of the current function and build reload_insn_chain,
and record register life information. */ and record register life information. */
void void
build_insn_chain (first) build_insn_chain (rtx first)
rtx first;
{ {
struct insn_chain **p = &reload_insn_chain; struct insn_chain **p = &reload_insn_chain;
struct insn_chain *prev = 0; struct insn_chain *prev = 0;
...@@ -1905,8 +1874,7 @@ build_insn_chain (first) ...@@ -1905,8 +1874,7 @@ build_insn_chain (first)
showing the information on which the allocation decisions are based. */ showing the information on which the allocation decisions are based. */
static void static void
dump_conflicts (file) dump_conflicts (FILE *file)
FILE *file;
{ {
int i; int i;
int has_preferences; int has_preferences;
...@@ -1963,8 +1931,7 @@ dump_conflicts (file) ...@@ -1963,8 +1931,7 @@ dump_conflicts (file)
} }
void void
dump_global_regs (file) dump_global_regs (FILE *file)
FILE *file;
{ {
int i, j; int i, j;
......
/* Output routines for graphical representation. /* 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. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
This file is part of GCC. This file is part of GCC.
...@@ -39,17 +39,16 @@ static const char *const graph_ext[] = ...@@ -39,17 +39,16 @@ static const char *const graph_ext[] =
/* vcg */ ".vcg", /* vcg */ ".vcg",
}; };
static void start_fct PARAMS ((FILE *)); static void start_fct (FILE *);
static void start_bb PARAMS ((FILE *, int)); static void start_bb (FILE *, int);
static void node_data PARAMS ((FILE *, rtx)); static void node_data (FILE *, rtx);
static void draw_edge PARAMS ((FILE *, int, int, int, int)); static void draw_edge (FILE *, int, int, int, int);
static void end_fct PARAMS ((FILE *)); static void end_fct (FILE *);
static void end_bb PARAMS ((FILE *)); static void end_bb (FILE *);
/* Output text for new basic block. */ /* Output text for new basic block. */
static void static void
start_fct (fp) start_fct (FILE *fp)
FILE *fp;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -64,9 +63,7 @@ graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n", ...@@ -64,9 +63,7 @@ graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n",
} }
static void static void
start_bb (fp, bb) start_bb (FILE *fp, int bb)
FILE *fp;
int bb;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -105,9 +102,7 @@ label: \"basic block %d", ...@@ -105,9 +102,7 @@ label: \"basic block %d",
} }
static void static void
node_data (fp, tmp_rtx) node_data (FILE *fp, rtx tmp_rtx)
FILE *fp;
rtx tmp_rtx;
{ {
if (PREV_INSN (tmp_rtx) == 0) if (PREV_INSN (tmp_rtx) == 0)
{ {
...@@ -168,12 +163,7 @@ darkgrey\n shape: ellipse" : "white", ...@@ -168,12 +163,7 @@ darkgrey\n shape: ellipse" : "white",
} }
static void static void
draw_edge (fp, from, to, bb_edge, class) draw_edge (FILE *fp, int from, int to, int bb_edge, int class)
FILE *fp;
int from;
int to;
int bb_edge;
int class;
{ {
const char * color; const char * color;
switch (graph_dump_format) switch (graph_dump_format)
...@@ -200,8 +190,7 @@ draw_edge (fp, from, to, bb_edge, class) ...@@ -200,8 +190,7 @@ draw_edge (fp, from, to, bb_edge, class)
} }
static void static void
end_bb (fp) end_bb (FILE *fp)
FILE *fp;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -214,8 +203,7 @@ end_bb (fp) ...@@ -214,8 +203,7 @@ end_bb (fp)
} }
static void static void
end_fct (fp) end_fct (FILE *fp)
FILE *fp;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -231,10 +219,7 @@ end_fct (fp) ...@@ -231,10 +219,7 @@ end_fct (fp)
/* Like print_rtl, but also print out live information for the start of each /* Like print_rtl, but also print out live information for the start of each
basic block. */ basic block. */
void void
print_rtl_graph_with_bb (base, suffix, rtx_first) print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
const char *base;
const char *suffix;
rtx rtx_first;
{ {
rtx tmp_rtx; rtx tmp_rtx;
size_t namelen = strlen (base); size_t namelen = strlen (base);
...@@ -400,9 +385,7 @@ print_rtl_graph_with_bb (base, suffix, rtx_first) ...@@ -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. */ /* Similar as clean_dump_file, but this time for graph output files. */
void void
clean_graph_dump_file (base, suffix) clean_graph_dump_file (const char *base, const char *suffix)
const char *base;
const char *suffix;
{ {
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix); size_t suffixlen = strlen (suffix);
...@@ -434,9 +417,7 @@ clean_graph_dump_file (base, suffix) ...@@ -434,9 +417,7 @@ clean_graph_dump_file (base, suffix)
/* Do final work on the graph output file. */ /* Do final work on the graph output file. */
void void
finish_graph_dump_file (base, suffix) finish_graph_dump_file (const char *base, const char *suffix)
const char *base;
const char *suffix;
{ {
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix); size_t suffixlen = strlen (suffix);
......
/* Header file for graph routines. /* 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. This file is part of GCC.
...@@ -21,8 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -21,8 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_GRAPH_H #ifndef GCC_GRAPH_H
#define GCC_GRAPH_H #define GCC_GRAPH_H
extern void print_rtl_graph_with_bb PARAMS ((const char *, const char *, rtx)); extern void print_rtl_graph_with_bb (const char *, const char *, rtx);
extern void clean_graph_dump_file PARAMS ((const char *, const char *)); extern void clean_graph_dump_file (const char *, const char *);
extern void finish_graph_dump_file PARAMS ((const char *, const char *)); extern void finish_graph_dump_file (const char *, const char *);
#endif /* ! GCC_GRAPH_H */ #endif /* ! GCC_GRAPH_H */
/* Instruction scheduling pass. /* Instruction scheduling pass.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 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, Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com) and currently maintained by, Jim Wilson (wilson@cygnus.com)
...@@ -189,8 +189,7 @@ static int old_max_uid; ...@@ -189,8 +189,7 @@ static int old_max_uid;
of the -fsched-verbose=N option. */ of the -fsched-verbose=N option. */
void void
fix_sched_param (param, val) fix_sched_param (const char *param, const char *val)
const char *param, *val;
{ {
if (!strcmp (param, "verbose")) if (!strcmp (param, "verbose"))
sched_verbose_param = atoi (val); sched_verbose_param = atoi (val);
...@@ -305,7 +304,7 @@ struct ready_list ...@@ -305,7 +304,7 @@ struct ready_list
int n_ready; 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. */ /* Nonzero iff the address is comprised from at most 1 register. */
#define CONST_BASED_ADDRESS_P(x) \ #define CONST_BASED_ADDRESS_P(x) \
...@@ -319,9 +318,7 @@ static int may_trap_exp PARAMS ((rtx, int)); ...@@ -319,9 +318,7 @@ static int may_trap_exp PARAMS ((rtx, int));
as found by analyzing insn's expression. */ as found by analyzing insn's expression. */
static int static int
may_trap_exp (x, is_store) may_trap_exp (rtx x, int is_store)
rtx x;
int is_store;
{ {
enum rtx_code code; enum rtx_code code;
...@@ -394,8 +391,7 @@ may_trap_exp (x, is_store) ...@@ -394,8 +391,7 @@ may_trap_exp (x, is_store)
being either PFREE or PRISKY. */ being either PFREE or PRISKY. */
int int
haifa_classify_insn (insn) haifa_classify_insn (rtx insn)
rtx insn;
{ {
rtx pat = PATTERN (insn); rtx pat = PATTERN (insn);
int tmp_class = TRAP_FREE; int tmp_class = TRAP_FREE;
...@@ -473,21 +469,21 @@ haifa_classify_insn (insn) ...@@ -473,21 +469,21 @@ haifa_classify_insn (insn)
/* The scheduler using only DFA description should never use the /* The scheduler using only DFA description should never use the
following five functions: */ following five functions: */
static unsigned int blockage_range PARAMS ((int, rtx)); static unsigned int blockage_range (int, rtx);
static void clear_units PARAMS ((void)); static void clear_units (void);
static void schedule_unit PARAMS ((int, rtx, int)); static void schedule_unit (int, rtx, int);
static int actual_hazard PARAMS ((int, rtx, int, int)); static int actual_hazard (int, rtx, int, int);
static int potential_hazard PARAMS ((int, rtx, int)); static int potential_hazard (int, rtx, int);
static int priority PARAMS ((rtx)); static int priority (rtx);
static int rank_for_schedule PARAMS ((const void *, const void *)); static int rank_for_schedule (const void *, const void *);
static void swap_sort PARAMS ((rtx *, int)); static void swap_sort (rtx *, int);
static void queue_insn PARAMS ((rtx, int)); static void queue_insn (rtx, int);
static int schedule_insn PARAMS ((rtx, struct ready_list *, int)); static int schedule_insn (rtx, struct ready_list *, int);
static int find_set_reg_weight PARAMS ((rtx)); static int find_set_reg_weight (rtx);
static void find_insn_reg_weight PARAMS ((int)); static void find_insn_reg_weight (int);
static void adjust_priority PARAMS ((rtx)); static void adjust_priority (rtx);
static void advance_one_cycle PARAMS ((void)); static void advance_one_cycle (void);
/* Notes handling mechanism: /* Notes handling mechanism:
========================= =========================
...@@ -512,28 +508,28 @@ static void advance_one_cycle PARAMS ((void)); ...@@ -512,28 +508,28 @@ static void advance_one_cycle PARAMS ((void));
unlink_other_notes ()). After scheduling the block, these notes are unlink_other_notes ()). After scheduling the block, these notes are
inserted at the beginning of the block (in schedule_block()). */ inserted at the beginning of the block (in schedule_block()). */
static rtx unlink_other_notes PARAMS ((rtx, rtx)); static rtx unlink_other_notes (rtx, rtx);
static rtx unlink_line_notes PARAMS ((rtx, rtx)); static rtx unlink_line_notes (rtx, rtx);
static rtx reemit_notes PARAMS ((rtx, rtx)); static rtx reemit_notes (rtx, rtx);
static rtx *ready_lastpos PARAMS ((struct ready_list *)); static rtx *ready_lastpos (struct ready_list *);
static void ready_sort PARAMS ((struct ready_list *)); static void ready_sort (struct ready_list *);
static rtx ready_remove_first PARAMS ((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_insn1 (rtx, rtx);
static rtx move_insn PARAMS ((rtx, rtx)); static rtx move_insn (rtx, rtx);
/* The following functions are used to implement multi-pass scheduling /* The following functions are used to implement multi-pass scheduling
on the first cycle. It is used only for DFA based scheduler. */ on the first cycle. It is used only for DFA based scheduler. */
static rtx ready_element PARAMS ((struct ready_list *, int)); static rtx ready_element (struct ready_list *, int);
static rtx ready_remove PARAMS ((struct ready_list *, int)); static rtx ready_remove (struct ready_list *, int);
static int max_issue PARAMS ((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 */ #endif /* INSN_SCHEDULING */
...@@ -542,8 +538,7 @@ struct sched_info *current_sched_info; ...@@ -542,8 +538,7 @@ struct sched_info *current_sched_info;
#ifndef INSN_SCHEDULING #ifndef INSN_SCHEDULING
void void
schedule_insns (dump_file) schedule_insns (FILE *dump_file ATTRIBUTE_UNUSED)
FILE *dump_file ATTRIBUTE_UNUSED;
{ {
} }
#else #else
...@@ -562,8 +557,7 @@ static rtx last_scheduled_insn; ...@@ -562,8 +557,7 @@ static rtx last_scheduled_insn;
should never use the following function. */ should never use the following function. */
HAIFA_INLINE int HAIFA_INLINE int
insn_unit (insn) insn_unit (rtx insn)
rtx insn;
{ {
int unit = INSN_UNIT (insn); int unit = INSN_UNIT (insn);
...@@ -601,9 +595,7 @@ insn_unit (insn) ...@@ -601,9 +595,7 @@ insn_unit (insn)
function. */ function. */
HAIFA_INLINE static unsigned int HAIFA_INLINE static unsigned int
blockage_range (unit, insn) blockage_range (int unit, rtx insn)
int unit;
rtx insn;
{ {
unsigned int blockage = INSN_BLOCKAGE (insn); unsigned int blockage = INSN_BLOCKAGE (insn);
unsigned int range; unsigned int range;
...@@ -656,8 +648,7 @@ static int unit_n_insns[1]; ...@@ -656,8 +648,7 @@ static int unit_n_insns[1];
following function. */ following function. */
rtx rtx
get_unit_last_insn (instance) get_unit_last_insn (int instance)
int instance;
{ {
return unit_last_insn[instance]; return unit_last_insn[instance];
} }
...@@ -665,7 +656,7 @@ get_unit_last_insn (instance) ...@@ -665,7 +656,7 @@ get_unit_last_insn (instance)
/* Reset the function unit state to the null state. */ /* Reset the function unit state to the null state. */
static void static void
clear_units () clear_units (void)
{ {
memset ((char *) unit_last_insn, 0, sizeof (unit_last_insn)); memset ((char *) unit_last_insn, 0, sizeof (unit_last_insn));
memset ((char *) unit_tick, 0, sizeof (unit_tick)); memset ((char *) unit_tick, 0, sizeof (unit_tick));
...@@ -676,8 +667,7 @@ clear_units () ...@@ -676,8 +667,7 @@ clear_units ()
description should never use the following function. */ description should never use the following function. */
HAIFA_INLINE int HAIFA_INLINE int
insn_issue_delay (insn) insn_issue_delay (rtx insn)
rtx insn;
{ {
int i, delay = 0; int i, delay = 0;
int unit = insn_unit (insn); int unit = insn_unit (insn);
...@@ -707,9 +697,7 @@ insn_issue_delay (insn) ...@@ -707,9 +697,7 @@ insn_issue_delay (insn)
use the following function. */ use the following function. */
HAIFA_INLINE int HAIFA_INLINE int
actual_hazard_this_instance (unit, instance, insn, clock, cost) actual_hazard_this_instance (int unit, int instance, rtx insn, int clock, int cost)
int unit, instance, clock, cost;
rtx insn;
{ {
int tick = unit_tick[instance]; /* Issue time of the last issued insn. */ 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) ...@@ -745,9 +733,7 @@ actual_hazard_this_instance (unit, instance, insn, clock, cost)
never use the following function. */ never use the following function. */
HAIFA_INLINE static void HAIFA_INLINE static void
schedule_unit (unit, insn, clock) schedule_unit (int unit, rtx insn, int clock)
int unit, clock;
rtx insn;
{ {
int i; int i;
...@@ -779,9 +765,7 @@ schedule_unit (unit, insn, clock) ...@@ -779,9 +765,7 @@ schedule_unit (unit, insn, clock)
use the following function. */ use the following function. */
HAIFA_INLINE static int HAIFA_INLINE static int
actual_hazard (unit, insn, clock, cost) actual_hazard (int unit, rtx insn, int clock, int cost)
int unit, clock, cost;
rtx insn;
{ {
int i; int i;
...@@ -830,9 +814,7 @@ actual_hazard (unit, insn, clock, cost) ...@@ -830,9 +814,7 @@ actual_hazard (unit, insn, clock, cost)
the following function. */ the following function. */
HAIFA_INLINE static int HAIFA_INLINE static int
potential_hazard (unit, insn, cost) potential_hazard (int unit, rtx insn, int cost)
int unit, cost;
rtx insn;
{ {
int i, ncost; int i, ncost;
unsigned int minb, maxb; unsigned int minb, maxb;
...@@ -875,8 +857,7 @@ potential_hazard (unit, insn, cost) ...@@ -875,8 +857,7 @@ potential_hazard (unit, insn, cost)
instruction results. */ instruction results. */
HAIFA_INLINE int HAIFA_INLINE int
insn_cost (insn, link, used) insn_cost (rtx insn, rtx link, rtx used)
rtx insn, link, used;
{ {
int cost = INSN_COST (insn); int cost = INSN_COST (insn);
...@@ -898,10 +879,10 @@ insn_cost (insn, link, used) ...@@ -898,10 +879,10 @@ insn_cost (insn, link, used)
cost = insn_default_latency (insn); cost = insn_default_latency (insn);
else else
cost = result_ready_cost (insn); cost = result_ready_cost (insn);
if (cost < 0) if (cost < 0)
cost = 0; cost = 0;
INSN_COST (insn) = cost; INSN_COST (insn) = cost;
} }
} }
...@@ -942,15 +923,14 @@ insn_cost (insn, link, used) ...@@ -942,15 +923,14 @@ insn_cost (insn, link, used)
if (cost < 0) if (cost < 0)
cost = 0; cost = 0;
} }
return cost; return cost;
} }
/* Compute the priority number for INSN. */ /* Compute the priority number for INSN. */
static int static int
priority (insn) priority (rtx insn)
rtx insn;
{ {
rtx link; rtx link;
...@@ -1006,9 +986,7 @@ while (0) ...@@ -1006,9 +986,7 @@ while (0)
unstable. */ unstable. */
static int static int
rank_for_schedule (x, y) rank_for_schedule (const void *x, const void *y)
const void *x;
const void *y;
{ {
rtx tmp = *(const rtx *) y; rtx tmp = *(const rtx *) y;
rtx tmp2 = *(const rtx *) x; rtx tmp2 = *(const rtx *) x;
...@@ -1087,9 +1065,7 @@ rank_for_schedule (x, y) ...@@ -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. */ /* Resort the array A in which only element at index N may be out of order. */
HAIFA_INLINE static void HAIFA_INLINE static void
swap_sort (a, n) swap_sort (rtx *a, int n)
rtx *a;
int n;
{ {
rtx insn = a[n - 1]; rtx insn = a[n - 1];
int i = n - 2; int i = n - 2;
...@@ -1107,9 +1083,7 @@ swap_sort (a, n) ...@@ -1107,9 +1083,7 @@ swap_sort (a, n)
chain for debugging purposes. */ chain for debugging purposes. */
HAIFA_INLINE static void HAIFA_INLINE static void
queue_insn (insn, n_cycles) queue_insn (rtx insn, int n_cycles)
rtx insn;
int n_cycles;
{ {
int next_q = NEXT_Q_AFTER (q_ptr, n_cycles); int next_q = NEXT_Q_AFTER (q_ptr, n_cycles);
rtx link = alloc_INSN_LIST (insn, insn_queue[next_q]); rtx link = alloc_INSN_LIST (insn, insn_queue[next_q]);
...@@ -1129,8 +1103,7 @@ queue_insn (insn, n_cycles) ...@@ -1129,8 +1103,7 @@ queue_insn (insn, n_cycles)
with the lowest priority. */ with the lowest priority. */
HAIFA_INLINE static rtx * HAIFA_INLINE static rtx *
ready_lastpos (ready) ready_lastpos (struct ready_list *ready)
struct ready_list *ready;
{ {
if (ready->n_ready == 0) if (ready->n_ready == 0)
abort (); abort ();
...@@ -1141,9 +1114,7 @@ ready_lastpos (ready) ...@@ -1141,9 +1114,7 @@ ready_lastpos (ready)
priority. */ priority. */
HAIFA_INLINE void HAIFA_INLINE void
ready_add (ready, insn) ready_add (struct ready_list *ready, rtx insn)
struct ready_list *ready;
rtx insn;
{ {
if (ready->first == ready->n_ready) if (ready->first == ready->n_ready)
{ {
...@@ -1160,8 +1131,7 @@ ready_add (ready, insn) ...@@ -1160,8 +1131,7 @@ ready_add (ready, insn)
return it. */ return it. */
HAIFA_INLINE static rtx HAIFA_INLINE static rtx
ready_remove_first (ready) ready_remove_first (struct ready_list *ready)
struct ready_list *ready;
{ {
rtx t; rtx t;
if (ready->n_ready == 0) if (ready->n_ready == 0)
...@@ -1183,9 +1153,7 @@ ready_remove_first (ready) ...@@ -1183,9 +1153,7 @@ ready_remove_first (ready)
N_READY - 1. */ N_READY - 1. */
HAIFA_INLINE static rtx HAIFA_INLINE static rtx
ready_element (ready, index) ready_element (struct ready_list *ready, int index)
struct ready_list *ready;
int index;
{ {
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
if (ready->n_ready == 0 || index >= ready->n_ready) if (ready->n_ready == 0 || index >= ready->n_ready)
...@@ -1199,9 +1167,7 @@ ready_element (ready, index) ...@@ -1199,9 +1167,7 @@ ready_element (ready, index)
has N_READY - 1. */ has N_READY - 1. */
HAIFA_INLINE static rtx HAIFA_INLINE static rtx
ready_remove (ready, index) ready_remove (struct ready_list *ready, int index)
struct ready_list *ready;
int index;
{ {
rtx t; rtx t;
int i; int i;
...@@ -1222,8 +1188,7 @@ ready_remove (ready, index) ...@@ -1222,8 +1188,7 @@ ready_remove (ready, index)
macro. */ macro. */
HAIFA_INLINE static void HAIFA_INLINE static void
ready_sort (ready) ready_sort (struct ready_list *ready)
struct ready_list *ready;
{ {
rtx *first = ready_lastpos (ready); rtx *first = ready_lastpos (ready);
SCHED_SORT (first, ready->n_ready); SCHED_SORT (first, ready->n_ready);
...@@ -1234,8 +1199,7 @@ ready_sort (ready) ...@@ -1234,8 +1199,7 @@ ready_sort (ready)
provide a hook for the target to tweek itself. */ provide a hook for the target to tweek itself. */
HAIFA_INLINE static void HAIFA_INLINE static void
adjust_priority (prev) adjust_priority (rtx prev)
rtx prev;
{ {
/* ??? There used to be code here to try and estimate how an insn /* ??? 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 affected register lifetimes, but it did it by looking at REG_DEAD
...@@ -1251,7 +1215,7 @@ adjust_priority (prev) ...@@ -1251,7 +1215,7 @@ adjust_priority (prev)
/* Advance time on one cycle. */ /* Advance time on one cycle. */
HAIFA_INLINE static void HAIFA_INLINE static void
advance_one_cycle () advance_one_cycle (void)
{ {
if (targetm.sched.use_dfa_pipeline_interface if (targetm.sched.use_dfa_pipeline_interface
&& (*targetm.sched.use_dfa_pipeline_interface) ()) && (*targetm.sched.use_dfa_pipeline_interface) ())
...@@ -1278,10 +1242,7 @@ static int last_clock_var; ...@@ -1278,10 +1242,7 @@ static int last_clock_var;
zero for insns in a schedule group). */ zero for insns in a schedule group). */
static int static int
schedule_insn (insn, ready, clock) schedule_insn (rtx insn, struct ready_list *ready, int clock)
rtx insn;
struct ready_list *ready;
int clock;
{ {
rtx link; rtx link;
int advance = 0; int advance = 0;
...@@ -1324,7 +1285,7 @@ schedule_insn (insn, ready, clock) ...@@ -1324,7 +1285,7 @@ schedule_insn (insn, ready, clock)
if (MAX_BLOCKAGE > 1 || issue_rate > 1 || sched_verbose) if (MAX_BLOCKAGE > 1 || issue_rate > 1 || sched_verbose)
schedule_unit (unit, insn, clock); schedule_unit (unit, insn, clock);
if (INSN_DEPEND (insn) == 0) if (INSN_DEPEND (insn) == 0)
return 0; return 0;
} }
...@@ -1393,8 +1354,7 @@ schedule_insn (insn, ready, clock) ...@@ -1393,8 +1354,7 @@ schedule_insn (insn, ready, clock)
Returns the insn following the notes. */ Returns the insn following the notes. */
static rtx static rtx
unlink_other_notes (insn, tail) unlink_other_notes (rtx insn, rtx tail)
rtx insn, tail;
{ {
rtx prev = PREV_INSN (insn); rtx prev = PREV_INSN (insn);
...@@ -1430,8 +1390,7 @@ unlink_other_notes (insn, tail) ...@@ -1430,8 +1390,7 @@ unlink_other_notes (insn, tail)
they can be reused. Returns the insn following the notes. */ they can be reused. Returns the insn following the notes. */
static rtx static rtx
unlink_line_notes (insn, tail) unlink_line_notes (rtx insn, rtx tail)
rtx insn, tail;
{ {
rtx prev = PREV_INSN (insn); rtx prev = PREV_INSN (insn);
...@@ -1461,10 +1420,7 @@ unlink_line_notes (insn, tail) ...@@ -1461,10 +1420,7 @@ unlink_line_notes (insn, tail)
/* Return the head and tail pointers of BB. */ /* Return the head and tail pointers of BB. */
void void
get_block_head_tail (b, headp, tailp) get_block_head_tail (int b, rtx *headp, rtx *tailp)
int b;
rtx *headp;
rtx *tailp;
{ {
/* HEAD and TAIL delimit the basic block being scheduled. */ /* HEAD and TAIL delimit the basic block being scheduled. */
rtx head = BLOCK_HEAD (b); rtx head = BLOCK_HEAD (b);
...@@ -1491,8 +1447,7 @@ get_block_head_tail (b, headp, tailp) ...@@ -1491,8 +1447,7 @@ get_block_head_tail (b, headp, tailp)
/* Return nonzero if there are no real insns in the range [ HEAD, TAIL ]. */ /* Return nonzero if there are no real insns in the range [ HEAD, TAIL ]. */
int int
no_real_insns_p (head, tail) no_real_insns_p (rtx head, rtx tail)
rtx head, tail;
{ {
while (head != NEXT_INSN (tail)) while (head != NEXT_INSN (tail))
{ {
...@@ -1508,8 +1463,7 @@ no_real_insns_p (head, tail) ...@@ -1508,8 +1463,7 @@ no_real_insns_p (head, tail)
block in which notes should be processed. */ block in which notes should be processed. */
void void
rm_line_notes (head, tail) rm_line_notes (rtx head, rtx tail)
rtx head, tail;
{ {
rtx next_tail; rtx next_tail;
rtx insn; rtx insn;
...@@ -1541,9 +1495,7 @@ rm_line_notes (head, tail) ...@@ -1541,9 +1495,7 @@ rm_line_notes (head, tail)
the boundaries of the block in which notes should be processed. */ the boundaries of the block in which notes should be processed. */
void void
save_line_notes (b, head, tail) save_line_notes (int b, rtx head, rtx tail)
int b;
rtx head, tail;
{ {
rtx next_tail; rtx next_tail;
...@@ -1569,8 +1521,7 @@ save_line_notes (b, head, tail) ...@@ -1569,8 +1521,7 @@ save_line_notes (b, head, tail)
be processed. */ be processed. */
void void
restore_line_notes (head, tail) restore_line_notes (rtx head, rtx tail)
rtx head, tail;
{ {
rtx line, note, prev, new; rtx line, note, prev, new;
int added_notes = 0; int added_notes = 0;
...@@ -1633,7 +1584,7 @@ restore_line_notes (head, tail) ...@@ -1633,7 +1584,7 @@ restore_line_notes (head, tail)
insns list. */ insns list. */
void void
rm_redundant_line_notes () rm_redundant_line_notes (void)
{ {
rtx line = 0; rtx line = 0;
rtx insn = get_insns (); rtx insn = get_insns ();
...@@ -1682,9 +1633,7 @@ rm_redundant_line_notes () ...@@ -1682,9 +1633,7 @@ rm_redundant_line_notes ()
of notes ended by NOTE_LIST. */ of notes ended by NOTE_LIST. */
void void
rm_other_notes (head, tail) rm_other_notes (rtx head, rtx tail)
rtx head;
rtx tail;
{ {
rtx next_tail; rtx next_tail;
rtx insn; rtx insn;
...@@ -1724,8 +1673,7 @@ rm_other_notes (head, tail) ...@@ -1724,8 +1673,7 @@ rm_other_notes (head, tail)
a new register is not needed. */ a new register is not needed. */
static int static int
find_set_reg_weight (x) find_set_reg_weight (rtx x)
rtx x;
{ {
if (GET_CODE (x) == CLOBBER if (GET_CODE (x) == CLOBBER
&& register_operand (SET_DEST (x), VOIDmode)) && register_operand (SET_DEST (x), VOIDmode))
...@@ -1748,8 +1696,7 @@ find_set_reg_weight (x) ...@@ -1748,8 +1696,7 @@ find_set_reg_weight (x)
/* Calculate INSN_REG_WEIGHT for all insns of a block. */ /* Calculate INSN_REG_WEIGHT for all insns of a block. */
static void static void
find_insn_reg_weight (b) find_insn_reg_weight (int b)
int b;
{ {
rtx insn, next_tail, head, tail; rtx insn, next_tail, head, tail;
...@@ -1769,14 +1716,14 @@ find_insn_reg_weight (b) ...@@ -1769,14 +1716,14 @@ find_insn_reg_weight (b)
x = PATTERN (insn); x = PATTERN (insn);
reg_weight += find_set_reg_weight (x); reg_weight += find_set_reg_weight (x);
if (GET_CODE (x) == PARALLEL) if (GET_CODE (x) == PARALLEL)
{ {
int j; int j;
for (j = XVECLEN (x, 0) - 1; j >= 0; j--) for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
{ {
x = XVECEXP (PATTERN (insn), 0, j); x = XVECEXP (PATTERN (insn), 0, j);
reg_weight += find_set_reg_weight (x); reg_weight += find_set_reg_weight (x);
} }
} }
/* Decrement weight for each register that dies here. */ /* Decrement weight for each register that dies here. */
for (x = REG_NOTES (insn); x; x = XEXP (x, 1)) for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
{ {
...@@ -1795,8 +1742,7 @@ static int clock_var; ...@@ -1795,8 +1742,7 @@ static int clock_var;
/* Move insns that became ready to fire from queue to ready list. */ /* Move insns that became ready to fire from queue to ready list. */
static void static void
queue_to_ready (ready) queue_to_ready (struct ready_list *ready)
struct ready_list *ready;
{ {
rtx insn; rtx insn;
rtx link; rtx link;
...@@ -1866,8 +1812,7 @@ queue_to_ready (ready) ...@@ -1866,8 +1812,7 @@ queue_to_ready (ready)
/* Print the ready list for debugging purposes. Callable from debugger. */ /* Print the ready list for debugging purposes. Callable from debugger. */
static void static void
debug_ready_list (ready) debug_ready_list (struct ready_list *ready)
struct ready_list *ready;
{ {
rtx *p; rtx *p;
int i; int i;
...@@ -1887,8 +1832,7 @@ debug_ready_list (ready) ...@@ -1887,8 +1832,7 @@ debug_ready_list (ready)
/* move_insn1: Remove INSN from insn chain, and link it after LAST insn. */ /* move_insn1: Remove INSN from insn chain, and link it after LAST insn. */
static rtx static rtx
move_insn1 (insn, last) move_insn1 (rtx insn, rtx last)
rtx insn, last;
{ {
NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
...@@ -1910,9 +1854,7 @@ move_insn1 (insn, last) ...@@ -1910,9 +1854,7 @@ move_insn1 (insn, last)
output by the instruction scheduler. Return the new value of LAST. */ output by the instruction scheduler. Return the new value of LAST. */
static rtx static rtx
reemit_notes (insn, last) reemit_notes (rtx insn, rtx last)
rtx insn;
rtx last;
{ {
rtx note, retval; rtx note, retval;
...@@ -1941,8 +1883,7 @@ reemit_notes (insn, last) ...@@ -1941,8 +1883,7 @@ reemit_notes (insn, last)
return value from the first call to reemit_notes. */ return value from the first call to reemit_notes. */
static rtx static rtx
move_insn (insn, last) move_insn (rtx insn, rtx last)
rtx insn, last;
{ {
rtx retval = NULL; rtx retval = NULL;
...@@ -2011,9 +1952,7 @@ static int cached_issue_rate = 0; ...@@ -2011,9 +1952,7 @@ static int cached_issue_rate = 0;
of the best insn in READY. The following function is used only for of the best insn in READY. The following function is used only for
first cycle multipass scheduling. */ first cycle multipass scheduling. */
static int static int
max_issue (ready, index) max_issue (struct ready_list *ready, int *index)
struct ready_list *ready;
int *index;
{ {
int n, i, all, n_ready, best, delay, tries_num; int n, i, all, n_ready, best, delay, tries_num;
struct choice_entry *top; struct choice_entry *top;
...@@ -2089,8 +2028,7 @@ max_issue (ready, index) ...@@ -2089,8 +2028,7 @@ max_issue (ready, index)
cycle multipass scheduling. */ cycle multipass scheduling. */
static rtx static rtx
choose_ready (ready) choose_ready (struct ready_list *ready)
struct ready_list *ready;
{ {
int lookahead = 0; int lookahead = 0;
...@@ -2133,8 +2071,7 @@ choose_ready (ready) ...@@ -2133,8 +2071,7 @@ choose_ready (ready)
the instruction stream. */ the instruction stream. */
rtx rtx
sched_emit_insn (pat) sched_emit_insn (rtx pat)
rtx pat;
{ {
rtx insn = emit_insn_after (pat, last_scheduled_insn); rtx insn = emit_insn_after (pat, last_scheduled_insn);
last_scheduled_insn = insn; last_scheduled_insn = insn;
...@@ -2145,9 +2082,7 @@ sched_emit_insn (pat) ...@@ -2145,9 +2082,7 @@ sched_emit_insn (pat)
possibly bringing insns from subsequent blocks in the same region. */ possibly bringing insns from subsequent blocks in the same region. */
void void
schedule_block (b, rgn_n_insns) schedule_block (int b, int rgn_n_insns)
int b;
int rgn_n_insns;
{ {
struct ready_list ready; struct ready_list ready;
int i, first_cycle_insn_p; int i, first_cycle_insn_p;
...@@ -2248,18 +2183,18 @@ schedule_block (b, rgn_n_insns) ...@@ -2248,18 +2183,18 @@ schedule_block (b, rgn_n_insns)
start_clock_var = clock_var; start_clock_var = clock_var;
clock_var++; clock_var++;
advance_one_cycle (); advance_one_cycle ();
/* Add to the ready list all pending insns that can be issued now. /* Add to the ready list all pending insns that can be issued now.
If there are no ready insns, increment clock until one If there are no ready insns, increment clock until one
is ready and add all pending insns at that point to the ready is ready and add all pending insns at that point to the ready
list. */ list. */
queue_to_ready (&ready); queue_to_ready (&ready);
if (ready.n_ready == 0) if (ready.n_ready == 0)
abort (); abort ();
if (sched_verbose >= 2) if (sched_verbose >= 2)
{ {
fprintf (sched_dump, ";;\t\tReady list after queue_to_ready: "); fprintf (sched_dump, ";;\t\tReady list after queue_to_ready: ");
...@@ -2273,7 +2208,7 @@ schedule_block (b, rgn_n_insns) ...@@ -2273,7 +2208,7 @@ schedule_block (b, rgn_n_insns)
{ {
/* Sort the ready list based on priority. */ /* Sort the ready list based on priority. */
ready_sort (&ready); ready_sort (&ready);
if (sched_verbose >= 2) if (sched_verbose >= 2)
{ {
fprintf (sched_dump, ";;\t\tReady list after ready_sort: "); fprintf (sched_dump, ";;\t\tReady list after ready_sort: ");
...@@ -2322,13 +2257,13 @@ schedule_block (b, rgn_n_insns) ...@@ -2322,13 +2257,13 @@ schedule_block (b, rgn_n_insns)
|| state_dead_lock_p (curr_state) || state_dead_lock_p (curr_state)
|| !(*current_sched_info->schedule_more_p) ()) || !(*current_sched_info->schedule_more_p) ())
break; break;
/* Select and remove the insn from the ready list. */ /* Select and remove the insn from the ready list. */
if (sort_p) if (sort_p)
insn = choose_ready (&ready); insn = choose_ready (&ready);
else else
insn = ready_remove_first (&ready); insn = ready_remove_first (&ready);
if (targetm.sched.dfa_new_cycle if (targetm.sched.dfa_new_cycle
&& (*targetm.sched.dfa_new_cycle) (sched_dump, sched_verbose, && (*targetm.sched.dfa_new_cycle) (sched_dump, sched_verbose,
insn, last_clock_var, insn, last_clock_var,
...@@ -2337,7 +2272,7 @@ schedule_block (b, rgn_n_insns) ...@@ -2337,7 +2272,7 @@ schedule_block (b, rgn_n_insns)
ready_add (&ready, insn); ready_add (&ready, insn);
break; break;
} }
sort_p = TRUE; sort_p = TRUE;
memcpy (temp_state, curr_state, dfa_state_size); memcpy (temp_state, curr_state, dfa_state_size);
if (recog_memoized (insn) < 0) if (recog_memoized (insn) < 0)
...@@ -2366,32 +2301,32 @@ schedule_block (b, rgn_n_insns) ...@@ -2366,32 +2301,32 @@ schedule_block (b, rgn_n_insns)
{ {
int j; int j;
rtx bubble; rtx bubble;
for (j = 0; for (j = 0;
(bubble = (*targetm.sched.dfa_bubble) (j)) (bubble = (*targetm.sched.dfa_bubble) (j))
!= NULL_RTX; != NULL_RTX;
j++) j++)
{ {
memcpy (temp_state, curr_state, dfa_state_size); memcpy (temp_state, curr_state, dfa_state_size);
if (state_transition (temp_state, bubble) < 0 if (state_transition (temp_state, bubble) < 0
&& state_transition (temp_state, insn) < 0) && state_transition (temp_state, insn) < 0)
break; break;
} }
if (bubble != NULL_RTX) if (bubble != NULL_RTX)
{ {
if (insert_schedule_bubbles_p) if (insert_schedule_bubbles_p)
{ {
rtx copy; rtx copy;
copy = copy_rtx (PATTERN (bubble)); copy = copy_rtx (PATTERN (bubble));
emit_insn_after (copy, last_scheduled_insn); emit_insn_after (copy, last_scheduled_insn);
last_scheduled_insn last_scheduled_insn
= NEXT_INSN (last_scheduled_insn); = NEXT_INSN (last_scheduled_insn);
INSN_CODE (last_scheduled_insn) INSN_CODE (last_scheduled_insn)
= INSN_CODE (bubble); = INSN_CODE (bubble);
/* Annotate the same for the first insns /* Annotate the same for the first insns
scheduling by using mode. */ scheduling by using mode. */
PUT_MODE (last_scheduled_insn, PUT_MODE (last_scheduled_insn,
...@@ -2399,20 +2334,20 @@ schedule_block (b, rgn_n_insns) ...@@ -2399,20 +2334,20 @@ schedule_block (b, rgn_n_insns)
? clock_var - last_clock_var ? clock_var - last_clock_var
: VOIDmode)); : VOIDmode));
last_clock_var = clock_var; last_clock_var = clock_var;
if (sched_verbose >= 2) if (sched_verbose >= 2)
{ {
fprintf (sched_dump, fprintf (sched_dump,
";;\t\t--> scheduling bubble insn <<<%d>>>:reservation ", ";;\t\t--> scheduling bubble insn <<<%d>>>:reservation ",
INSN_UID (last_scheduled_insn)); INSN_UID (last_scheduled_insn));
if (recog_memoized (last_scheduled_insn) if (recog_memoized (last_scheduled_insn)
< 0) < 0)
fprintf (sched_dump, "nothing"); fprintf (sched_dump, "nothing");
else else
print_reservation print_reservation
(sched_dump, last_scheduled_insn); (sched_dump, last_scheduled_insn);
fprintf (sched_dump, "\n"); fprintf (sched_dump, "\n");
} }
} }
...@@ -2447,7 +2382,7 @@ schedule_block (b, rgn_n_insns) ...@@ -2447,7 +2382,7 @@ schedule_block (b, rgn_n_insns)
cycle_issued_insns++; cycle_issued_insns++;
memcpy (curr_state, temp_state, dfa_state_size); memcpy (curr_state, temp_state, dfa_state_size);
} }
if (targetm.sched.variable_issue) if (targetm.sched.variable_issue)
can_issue_more = can_issue_more =
(*targetm.sched.variable_issue) (sched_dump, sched_verbose, (*targetm.sched.variable_issue) (sched_dump, sched_verbose,
...@@ -2515,7 +2450,7 @@ schedule_block (b, rgn_n_insns) ...@@ -2515,7 +2450,7 @@ schedule_block (b, rgn_n_insns)
if (!reload_completed) if (!reload_completed)
{ {
rtx insn, link, next; rtx insn, link, next;
/* INSN_TICK (minimum clock tick at which the insn becomes /* INSN_TICK (minimum clock tick at which the insn becomes
ready) may be not correct for the insn in the subsequent ready) may be not correct for the insn in the subsequent
blocks of the region. We should use a correct value of blocks of the region. We should use a correct value of
...@@ -2580,8 +2515,7 @@ schedule_block (b, rgn_n_insns) ...@@ -2580,8 +2515,7 @@ schedule_block (b, rgn_n_insns)
/* Set_priorities: compute priority of each insn in the block. */ /* Set_priorities: compute priority of each insn in the block. */
int int
set_priorities (head, tail) set_priorities (rtx head, rtx tail)
rtx head, tail;
{ {
rtx insn; rtx insn;
int n_insn; int n_insn;
...@@ -2610,8 +2544,7 @@ set_priorities (head, tail) ...@@ -2610,8 +2544,7 @@ set_priorities (head, tail)
for debugging output. */ for debugging output. */
void void
sched_init (dump_file) sched_init (FILE *dump_file)
FILE *dump_file;
{ {
int luid; int luid;
basic_block b; basic_block b;
...@@ -2659,14 +2592,14 @@ sched_init (dump_file) ...@@ -2659,14 +2592,14 @@ sched_init (dump_file)
{ {
if (targetm.sched.init_dfa_pre_cycle_insn) if (targetm.sched.init_dfa_pre_cycle_insn)
(*targetm.sched.init_dfa_pre_cycle_insn) (); (*targetm.sched.init_dfa_pre_cycle_insn) ();
if (targetm.sched.init_dfa_post_cycle_insn) if (targetm.sched.init_dfa_post_cycle_insn)
(*targetm.sched.init_dfa_post_cycle_insn) (); (*targetm.sched.init_dfa_post_cycle_insn) ();
if (targetm.sched.first_cycle_multipass_dfa_lookahead if (targetm.sched.first_cycle_multipass_dfa_lookahead
&& targetm.sched.init_dfa_bubbles) && targetm.sched.init_dfa_bubbles)
(*targetm.sched.init_dfa_bubbles) (); (*targetm.sched.init_dfa_bubbles) ();
dfa_start (); dfa_start ();
dfa_state_size = state_size (); dfa_state_size = state_size ();
curr_state = xmalloc (dfa_state_size); curr_state = xmalloc (dfa_state_size);
...@@ -2757,7 +2690,7 @@ sched_init (dump_file) ...@@ -2757,7 +2690,7 @@ sched_init (dump_file)
/* Free global data used during insn scheduling. */ /* Free global data used during insn scheduling. */
void void
sched_finish () sched_finish (void)
{ {
free (h_i_d); free (h_i_d);
......
/* Hash tables. /* 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 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 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. ...@@ -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 existing entry with a potential new one. Also, the ability to
delete members from the table has been removed. */ delete members from the table has been removed. */
static unsigned int calc_hash PARAMS ((const unsigned char *, unsigned int)); static unsigned int calc_hash (const unsigned char *, unsigned int);
static void ht_expand PARAMS ((hash_table *)); static void ht_expand (hash_table *);
/* Calculate the hash of the string STR of length LEN. */ /* Calculate the hash of the string STR of length LEN. */
static unsigned int static unsigned int
calc_hash (str, len) calc_hash (const unsigned char *str, unsigned int len)
const unsigned char *str;
unsigned int len;
{ {
unsigned int n = len; unsigned int n = len;
unsigned int r = 0; unsigned int r = 0;
...@@ -56,8 +54,7 @@ calc_hash (str, len) ...@@ -56,8 +54,7 @@ calc_hash (str, len)
/* Initialize an identifier hashtable. */ /* Initialize an identifier hashtable. */
hash_table * hash_table *
ht_create (order) ht_create (unsigned int order)
unsigned int order;
{ {
unsigned int nslots = 1 << order; unsigned int nslots = 1 << order;
hash_table *table; hash_table *table;
...@@ -77,8 +74,7 @@ ht_create (order) ...@@ -77,8 +74,7 @@ ht_create (order)
/* Frees all memory associated with a hash table. */ /* Frees all memory associated with a hash table. */
void void
ht_destroy (table) ht_destroy (hash_table *table)
hash_table *table;
{ {
obstack_free (&table->stack, NULL); obstack_free (&table->stack, NULL);
free (table->entries); free (table->entries);
...@@ -94,11 +90,8 @@ ht_destroy (table) ...@@ -94,11 +90,8 @@ ht_destroy (table)
CPP_ALLOCED and the item is assumed to be at the top of the CPP_ALLOCED and the item is assumed to be at the top of the
obstack. */ obstack. */
hashnode hashnode
ht_lookup (table, str, len, insert) ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
hash_table *table; enum ht_lookup_option insert)
const unsigned char *str;
unsigned int len;
enum ht_lookup_option insert;
{ {
unsigned int hash = calc_hash (str, len); unsigned int hash = calc_hash (str, len);
unsigned int hash2; unsigned int hash2;
...@@ -158,8 +151,7 @@ ht_lookup (table, str, len, insert) ...@@ -158,8 +151,7 @@ ht_lookup (table, str, len, insert)
/* Double the size of a hash table, re-hashing existing entries. */ /* Double the size of a hash table, re-hashing existing entries. */
static void static void
ht_expand (table) ht_expand (hash_table *table)
hash_table *table;
{ {
hashnode *nentries, *p, *limit; hashnode *nentries, *p, *limit;
unsigned int size, sizemask; unsigned int size, sizemask;
...@@ -200,10 +192,7 @@ ht_expand (table) ...@@ -200,10 +192,7 @@ ht_expand (table)
/* For all nodes in TABLE, callback CB with parameters TABLE->PFILE, /* For all nodes in TABLE, callback CB with parameters TABLE->PFILE,
the node, and V. */ the node, and V. */
void void
ht_forall (table, cb, v) ht_forall (hash_table *table, ht_cb cb, const void *v)
hash_table *table;
ht_cb cb;
const void *v;
{ {
hashnode *p, *limit; hashnode *p, *limit;
...@@ -221,8 +210,7 @@ ht_forall (table, cb, v) ...@@ -221,8 +210,7 @@ ht_forall (table, cb, v)
/* Dump allocation statistics to stderr. */ /* Dump allocation statistics to stderr. */
void void
ht_dump_statistics (table) ht_dump_statistics (hash_table *table)
hash_table *table;
{ {
size_t nelts, nids, overhead, headers; size_t nelts, nids, overhead, headers;
size_t total_bytes, longest, sum_of_squares; size_t total_bytes, longest, sum_of_squares;
...@@ -251,7 +239,7 @@ ht_dump_statistics (table) ...@@ -251,7 +239,7 @@ ht_dump_statistics (table)
nids++; nids++;
} }
while (++p < limit); while (++p < limit);
nelts = table->nelements; nelts = table->nelements;
overhead = obstack_memory_used (&table->stack) - total_bytes; overhead = obstack_memory_used (&table->stack) - total_bytes;
headers = table->nslots * sizeof (hashnode); headers = table->nslots * sizeof (hashnode);
...@@ -287,8 +275,7 @@ ht_dump_statistics (table) ...@@ -287,8 +275,7 @@ ht_dump_statistics (table)
/* Return the approximate positive square root of a number N. This is for /* Return the approximate positive square root of a number N. This is for
statistical reports, not code generation. */ statistical reports, not code generation. */
double double
approx_sqrt (x) approx_sqrt (double x)
double x;
{ {
double s, d; double s, d;
......
/* Hash tables. /* 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 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 under the terms of the GNU General Public License as published by the
...@@ -46,7 +46,7 @@ struct ht ...@@ -46,7 +46,7 @@ struct ht
hashnode *entries; hashnode *entries;
/* Call back. */ /* Call back. */
hashnode (*alloc_node) PARAMS ((hash_table *)); hashnode (*alloc_node) (hash_table *);
unsigned int nslots; /* Total slots in the entries array. */ unsigned int nslots; /* Total slots in the entries array. */
unsigned int nelements; /* Number of live elements. */ unsigned int nelements; /* Number of live elements. */
...@@ -60,25 +60,25 @@ struct ht ...@@ -60,25 +60,25 @@ struct ht
}; };
/* Initialize the hashtable with 2 ^ order entries. */ /* 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. */ /* 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 *, extern hashnode ht_lookup (hash_table *, const unsigned char *,
unsigned int, enum ht_lookup_option)); unsigned int, enum ht_lookup_option);
/* For all nodes in TABLE, make a callback. The callback takes /* For all nodes in TABLE, make a callback. The callback takes
TABLE->PFILE, the node, and a PTR, and the callback sequence stops TABLE->PFILE, the node, and a PTR, and the callback sequence stops
if the callback returns zero. */ if the callback returns zero. */
typedef int (*ht_cb) PARAMS ((struct cpp_reader *, hashnode, const void *)); typedef int (*ht_cb) (struct cpp_reader *, hashnode, const void *);
extern void ht_forall PARAMS ((hash_table *, ht_cb, const void *)); extern void ht_forall (hash_table *, ht_cb, const void *);
/* Dump allocation statistics to stderr. */ /* 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 /* Approximate positive square root of a host double. This is for
statistical reports, not code generation. */ statistical reports, not code generation. */
extern double approx_sqrt PARAMS ((double)); extern double approx_sqrt (double);
#endif /* GCC_HASHTABLE_H */ #endif /* GCC_HASHTABLE_H */
...@@ -30,13 +30,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -30,13 +30,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* Generic hook that does absolutely zappo. */ /* Generic hook that does absolutely zappo. */
void void
hook_void_void () hook_void_void (void)
{ {
} }
/* Generic hook that takes no arguments and returns false. */ /* Generic hook that takes no arguments and returns false. */
bool bool
hook_bool_void_false () hook_bool_void_false (void)
{ {
return false; return false;
} }
...@@ -58,63 +58,53 @@ hook_bool_bool_false (bool a ATTRIBUTE_UNUSED) ...@@ -58,63 +58,53 @@ hook_bool_bool_false (bool a ATTRIBUTE_UNUSED)
/* Generic hook that takes (tree, int) and does nothing. */ /* Generic hook that takes (tree, int) and does nothing. */
void void
hook_void_tree_int (a, b) hook_void_tree_int (tree a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
int b ATTRIBUTE_UNUSED;
{ {
} }
/* Generic hook that takes (FILE *, const char *) and does nothing. */ /* Generic hook that takes (FILE *, const char *) and does nothing. */
void void
hook_void_FILEptr_constcharptr (a, b) hook_void_FILEptr_constcharptr (FILE *a ATTRIBUTE_UNUSED, const char *b ATTRIBUTE_UNUSED)
FILE *a ATTRIBUTE_UNUSED;
const char *b ATTRIBUTE_UNUSED;
{ {
} }
/* Used for the TARGET_ASM_CAN_OUTPUT_MI_THUNK hook. */ /* Used for the TARGET_ASM_CAN_OUTPUT_MI_THUNK hook. */
bool bool
hook_bool_tree_hwi_hwi_tree_false (a, b, c, d) hook_bool_tree_hwi_hwi_tree_false (tree a ATTRIBUTE_UNUSED,
tree a ATTRIBUTE_UNUSED; HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED; HOST_WIDE_INT c ATTRIBUTE_UNUSED,
HOST_WIDE_INT c ATTRIBUTE_UNUSED; tree d ATTRIBUTE_UNUSED)
tree d ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_tree_hwi_hwi_tree_true (a, b, c, d) hook_bool_tree_hwi_hwi_tree_true (tree a ATTRIBUTE_UNUSED,
tree a ATTRIBUTE_UNUSED; HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED; HOST_WIDE_INT c ATTRIBUTE_UNUSED,
HOST_WIDE_INT c ATTRIBUTE_UNUSED; tree d ATTRIBUTE_UNUSED)
tree d ATTRIBUTE_UNUSED;
{ {
return true; return true;
} }
bool bool
default_can_output_mi_thunk_no_vcall (a, b, c, d) default_can_output_mi_thunk_no_vcall (tree a ATTRIBUTE_UNUSED,
tree a ATTRIBUTE_UNUSED; HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED; HOST_WIDE_INT c,
HOST_WIDE_INT c; tree d ATTRIBUTE_UNUSED)
tree d ATTRIBUTE_UNUSED;
{ {
return c == 0; return c == 0;
} }
/* ??? Used for comp_type_attributes, which ought to return bool. */ /* ??? Used for comp_type_attributes, which ought to return bool. */
int int
hook_int_tree_tree_1 (a, b) hook_int_tree_tree_1 (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
tree b ATTRIBUTE_UNUSED;
{ {
return 1; return 1;
} }
int int
hook_int_rtx_0 (a) hook_int_rtx_0 (rtx a ATTRIBUTE_UNUSED)
rtx a ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
...@@ -141,62 +131,52 @@ hook_uint_uint_constcharptrptr_0 (unsigned int a ATTRIBUTE_UNUSED, ...@@ -141,62 +131,52 @@ hook_uint_uint_constcharptrptr_0 (unsigned int a ATTRIBUTE_UNUSED,
} }
void void
hook_void_tree (a) hook_void_tree (tree a ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
{ {
} }
void void
hook_void_tree_treeptr (a, b) hook_void_tree_treeptr (tree a ATTRIBUTE_UNUSED, tree *b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
tree *b ATTRIBUTE_UNUSED;
{ {
} }
bool bool
hook_bool_tree_false (a) hook_bool_tree_false (tree a ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_tree_tree_false (a, b) hook_bool_tree_tree_false (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
tree b ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_rtx_false (a) hook_bool_rtx_false (rtx a ATTRIBUTE_UNUSED)
rtx a ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_rtx_int_int_intp_false (a, b, c, d) hook_bool_rtx_int_int_intp_false (rtx a ATTRIBUTE_UNUSED,
rtx a ATTRIBUTE_UNUSED; int b ATTRIBUTE_UNUSED,
int b ATTRIBUTE_UNUSED; int c ATTRIBUTE_UNUSED,
int c ATTRIBUTE_UNUSED; int *d ATTRIBUTE_UNUSED)
int *d ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
/* Generic hook that takes an rtx and returns it. */ /* Generic hook that takes an rtx and returns it. */
rtx rtx
hook_rtx_rtx_identity (x) hook_rtx_rtx_identity (rtx x)
rtx x;
{ {
return x; return x;
} }
/* Generic hook that takes an rtx and returns NULL_RTX. */ /* Generic hook that takes an rtx and returns NULL_RTX. */
rtx rtx
hook_rtx_rtx_null (x) hook_rtx_rtx_null (rtx x ATTRIBUTE_UNUSED)
rtx x ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
...@@ -22,36 +22,36 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -22,36 +22,36 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef GCC_HOOKS_H #ifndef GCC_HOOKS_H
#define 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_bool_false (bool);
bool hook_bool_tree_false PARAMS ((tree)); bool hook_bool_tree_false (tree);
bool hook_bool_tree_hwi_hwi_tree_false bool hook_bool_tree_hwi_hwi_tree_false (tree, HOST_WIDE_INT, HOST_WIDE_INT,
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); tree);
bool hook_bool_tree_hwi_hwi_tree_true bool hook_bool_tree_hwi_hwi_tree_true (tree, HOST_WIDE_INT, HOST_WIDE_INT,
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); tree);
bool hook_bool_rtx_false PARAMS ((rtx)); bool hook_bool_rtx_false (rtx);
bool hook_bool_rtx_int_int_intp_false PARAMS ((rtx, int, int, int *)); bool hook_bool_rtx_int_int_intp_false (rtx, int, int, int *);
void hook_void_tree_int PARAMS ((tree, int)); void hook_void_tree_int (tree, int);
void hook_void_void PARAMS ((void)); void hook_void_void (void);
void hook_void_FILEptr_constcharptr PARAMS ((FILE *, const char *)); void hook_void_FILEptr_constcharptr (FILE *, const char *);
void hook_void_tree PARAMS ((tree)); void hook_void_tree (tree);
void hook_void_tree_treeptr PARAMS ((tree, tree *)); void hook_void_tree_treeptr (tree, tree *);
int hook_int_tree_tree_1 PARAMS ((tree, tree)); int hook_int_tree_tree_1 (tree, tree);
int hook_int_rtx_0 PARAMS ((rtx)); int hook_int_rtx_0 (rtx);
int hook_int_void_0 (void); int hook_int_void_0 (void);
int hook_int_size_t_constcharptr_int_0 (size_t, const char *, int); int hook_int_size_t_constcharptr_int_0 (size_t, const char *, int);
int hook_int_void_no_regs (void); int hook_int_void_no_regs (void);
unsigned hook_uint_uint_constcharptrptr_0 (unsigned, const char **); unsigned hook_uint_uint_constcharptrptr_0 (unsigned, const char **);
bool default_can_output_mi_thunk_no_vcall bool default_can_output_mi_thunk_no_vcall (tree, HOST_WIDE_INT,
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); 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_identity (rtx);
rtx hook_rtx_rtx_null PARAMS ((rtx)); rtx hook_rtx_rtx_null (rtx);
#endif #endif
...@@ -21,9 +21,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,9 +21,9 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_HOST_HOOKS_H #ifndef GCC_HOST_HOOKS_H
#define 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. */ /* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
}; };
......
/* If-conversion support. /* 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. This file is part of GCC.
...@@ -86,37 +86,35 @@ static bool life_data_ok; ...@@ -86,37 +86,35 @@ static bool life_data_ok;
static dominance_info post_dominators; static dominance_info post_dominators;
/* Forward references. */ /* Forward references. */
static int count_bb_insns PARAMS ((basic_block)); static int count_bb_insns (basic_block);
static rtx first_active_insn PARAMS ((basic_block)); static rtx first_active_insn (basic_block);
static rtx last_active_insn PARAMS ((basic_block, int)); static rtx last_active_insn (basic_block, int);
static int seq_contains_jump PARAMS ((rtx)); static int seq_contains_jump (rtx);
static basic_block block_fallthru PARAMS ((basic_block)); static basic_block block_fallthru (basic_block);
static int cond_exec_process_insns PARAMS ((ce_if_block_t *, static int cond_exec_process_insns (ce_if_block_t *, rtx, rtx, rtx, rtx, int);
rtx, rtx, rtx, rtx, int)); static rtx cond_exec_get_condition (rtx);
static rtx cond_exec_get_condition PARAMS ((rtx)); static int cond_exec_process_if_block (ce_if_block_t *, int);
static int cond_exec_process_if_block PARAMS ((ce_if_block_t *, int)); static rtx noce_get_condition (rtx, rtx *);
static rtx noce_get_condition PARAMS ((rtx, rtx *)); static int noce_operand_ok (rtx);
static int noce_operand_ok PARAMS ((rtx)); static int noce_process_if_block (ce_if_block_t *);
static int noce_process_if_block PARAMS ((ce_if_block_t *)); static int process_if_block (ce_if_block_t *);
static int process_if_block PARAMS ((ce_if_block_t *)); static void merge_if_block (ce_if_block_t *);
static void merge_if_block PARAMS ((ce_if_block_t *)); static int find_cond_trap (basic_block, edge, edge);
static int find_cond_trap PARAMS ((basic_block, edge, edge)); static basic_block find_if_header (basic_block, int);
static basic_block find_if_header PARAMS ((basic_block, int)); static int block_jumps_and_fallthru_p (basic_block, basic_block);
static int block_jumps_and_fallthru_p PARAMS ((basic_block, basic_block)); static int find_if_block (ce_if_block_t *);
static int find_if_block PARAMS ((ce_if_block_t *)); static int find_if_case_1 (basic_block, edge, edge);
static int find_if_case_1 PARAMS ((basic_block, edge, edge)); static int find_if_case_2 (basic_block, edge, edge);
static int find_if_case_2 PARAMS ((basic_block, edge, edge)); static int find_memory (rtx *, void *);
static int find_memory PARAMS ((rtx *, void *)); static int dead_or_predicable (basic_block, basic_block, basic_block,
static int dead_or_predicable PARAMS ((basic_block, basic_block, basic_block, int);
basic_block, basic_block, int)); static void noce_emit_move_insn (rtx, rtx);
static void noce_emit_move_insn PARAMS ((rtx, rtx)); static rtx block_has_only_trap (basic_block);
static rtx block_has_only_trap PARAMS ((basic_block));
/* Count the number of non-jump active insns in BB. */ /* Count the number of non-jump active insns in BB. */
static int static int
count_bb_insns (bb) count_bb_insns (basic_block bb)
basic_block bb;
{ {
int count = 0; int count = 0;
rtx insn = bb->head; rtx insn = bb->head;
...@@ -137,8 +135,7 @@ count_bb_insns (bb) ...@@ -137,8 +135,7 @@ count_bb_insns (bb)
/* Return the first non-jump active insn in the basic block. */ /* Return the first non-jump active insn in the basic block. */
static rtx static rtx
first_active_insn (bb) first_active_insn (basic_block bb)
basic_block bb;
{ {
rtx insn = bb->head; rtx insn = bb->head;
...@@ -165,9 +162,7 @@ first_active_insn (bb) ...@@ -165,9 +162,7 @@ first_active_insn (bb)
/* Return the last non-jump active (non-jump) insn in the basic block. */ /* Return the last non-jump active (non-jump) insn in the basic block. */
static rtx static rtx
last_active_insn (bb, skip_use_p) last_active_insn (basic_block bb, int skip_use_p)
basic_block bb;
int skip_use_p;
{ {
rtx insn = bb->end; rtx insn = bb->end;
rtx head = bb->head; rtx head = bb->head;
...@@ -189,14 +184,13 @@ last_active_insn (bb, skip_use_p) ...@@ -189,14 +184,13 @@ last_active_insn (bb, skip_use_p)
return insn; 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 arithmetic, for the expanders to have emitted jumps. Search
through the sequence and return TRUE if a jump exists so that through the sequence and return TRUE if a jump exists so that
we can abort the conversion. */ we can abort the conversion. */
static int static int
seq_contains_jump (insn) seq_contains_jump (rtx insn)
rtx insn;
{ {
while (insn) while (insn)
{ {
...@@ -208,8 +202,7 @@ seq_contains_jump (insn) ...@@ -208,8 +202,7 @@ seq_contains_jump (insn)
} }
static basic_block static basic_block
block_fallthru (bb) block_fallthru (basic_block bb)
basic_block bb;
{ {
edge e; edge e;
...@@ -226,13 +219,12 @@ block_fallthru (bb) ...@@ -226,13 +219,12 @@ block_fallthru (bb)
insns were processed. */ insns were processed. */
static int static int
cond_exec_process_insns (ce_info, start, end, test, prob_val, mod_ok) cond_exec_process_insns (ce_if_block_t *ce_info ATTRIBUTE_UNUSED,
ce_if_block_t *ce_info ATTRIBUTE_UNUSED; /* if block information */ /* if block information */rtx start,
rtx start; /* first insn to look at */ /* first insn to look at */rtx end,
rtx end; /* last insn to look at */ /* last insn to look at */rtx test,
rtx test; /* conditional execution test */ /* conditional execution test */rtx prob_val,
rtx prob_val; /* probability of branch taken. */ /* probability of branch taken. */int mod_ok)
int mod_ok; /* true if modifications ok last insn. */
{ {
int must_be_last = FALSE; int must_be_last = FALSE;
rtx insn; rtx insn;
...@@ -253,7 +245,7 @@ cond_exec_process_insns (ce_info, start, end, test, prob_val, mod_ok) ...@@ -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. */ /* Remove USE insns that get in the way. */
if (reload_completed && GET_CODE (PATTERN (insn)) == USE) 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. */ given what we'd have to coordinate with our callers. */
PUT_CODE (insn, NOTE); PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
...@@ -317,8 +309,7 @@ cond_exec_process_insns (ce_info, start, end, test, prob_val, mod_ok) ...@@ -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. */ /* Return the condition for a jump. Do not do any special processing. */
static rtx static rtx
cond_exec_get_condition (jump) cond_exec_get_condition (rtx jump)
rtx jump;
{ {
rtx test_if, cond; rtx test_if, cond;
...@@ -349,9 +340,8 @@ cond_exec_get_condition (jump) ...@@ -349,9 +340,8 @@ cond_exec_get_condition (jump)
converting the block. */ converting the block. */
static int static int
cond_exec_process_if_block (ce_info, do_multiple_p) cond_exec_process_if_block (ce_if_block_t * ce_info,
ce_if_block_t * ce_info; /* if block information */ /* if block information */int do_multiple_p)
int do_multiple_p; /* != 0 if we should handle && and || blocks */
{ {
basic_block test_bb = ce_info->test_bb; /* last test block */ basic_block test_bb = ce_info->test_bb; /* last test block */
basic_block then_bb = ce_info->then_bb; /* THEN */ basic_block then_bb = ce_info->then_bb; /* THEN */
...@@ -416,7 +406,7 @@ cond_exec_process_if_block (ce_info, do_multiple_p) ...@@ -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 /* Map test_expr/test_jump into the appropriate MD tests to use on
the conditionally executed code. */ the conditionally executed code. */
true_expr = test_expr; true_expr = test_expr;
false_code = reversed_comparison_code (true_expr, test_bb->end); false_code = reversed_comparison_code (true_expr, test_bb->end);
...@@ -566,10 +556,10 @@ cond_exec_process_if_block (ce_info, do_multiple_p) ...@@ -566,10 +556,10 @@ cond_exec_process_if_block (ce_info, do_multiple_p)
return FALSE; 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 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. */ before cond_earliest. */
struct noce_if_info struct noce_if_info
...@@ -580,29 +570,24 @@ struct noce_if_info ...@@ -580,29 +570,24 @@ struct noce_if_info
rtx jump, cond, cond_earliest; rtx jump, cond, cond_earliest;
}; };
static rtx noce_emit_store_flag PARAMS ((struct noce_if_info *, static rtx noce_emit_store_flag (struct noce_if_info *, rtx, int, int);
rtx, int, int)); static int noce_try_store_flag (struct noce_if_info *);
static int noce_try_store_flag PARAMS ((struct noce_if_info *)); static int noce_try_addcc (struct noce_if_info *);
static int noce_try_addcc PARAMS ((struct noce_if_info *)); static int noce_try_store_flag_constants (struct noce_if_info *);
static int noce_try_store_flag_constants PARAMS ((struct noce_if_info *)); static int noce_try_store_flag_mask (struct noce_if_info *);
static int noce_try_store_flag_mask PARAMS ((struct noce_if_info *)); static rtx noce_emit_cmove (struct noce_if_info *, rtx, enum rtx_code, rtx,
static rtx noce_emit_cmove PARAMS ((struct noce_if_info *, rtx, rtx, rtx);
rtx, enum rtx_code, rtx, static int noce_try_cmove (struct noce_if_info *);
rtx, rtx, rtx)); static int noce_try_cmove_arith (struct noce_if_info *);
static int noce_try_cmove PARAMS ((struct noce_if_info *)); static rtx noce_get_alt_condition (struct noce_if_info *, rtx, rtx *);
static int noce_try_cmove_arith PARAMS ((struct noce_if_info *)); static int noce_try_minmax (struct noce_if_info *);
static rtx noce_get_alt_condition PARAMS ((struct noce_if_info *, static int noce_try_abs (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 *));
/* Helper function for noce_try_store_flag*. */ /* Helper function for noce_try_store_flag*. */
static rtx static rtx
noce_emit_store_flag (if_info, x, reversep, normalize) noce_emit_store_flag (struct noce_if_info *if_info, rtx x, int reversep,
struct noce_if_info *if_info; int normalize)
rtx x;
int reversep, normalize;
{ {
rtx cond = if_info->cond; rtx cond = if_info->cond;
int cond_complex; int cond_complex;
...@@ -660,8 +645,7 @@ noce_emit_store_flag (if_info, x, reversep, normalize) ...@@ -660,8 +645,7 @@ noce_emit_store_flag (if_info, x, reversep, normalize)
/* Emit instruction to move an rtx into STRICT_LOW_PART. */ /* Emit instruction to move an rtx into STRICT_LOW_PART. */
static void static void
noce_emit_move_insn (x, y) noce_emit_move_insn (rtx x, rtx y)
rtx x, y;
{ {
enum machine_mode outmode, inmode; enum machine_mode outmode, inmode;
rtx outer, inner; rtx outer, inner;
...@@ -689,8 +673,7 @@ noce_emit_move_insn (x, y) ...@@ -689,8 +673,7 @@ noce_emit_move_insn (x, y)
a go at the conversion. */ a go at the conversion. */
static int static int
noce_try_store_flag (if_info) noce_try_store_flag (struct noce_if_info *if_info)
struct noce_if_info *if_info;
{ {
int reversep; int reversep;
rtx target, seq; rtx target, seq;
...@@ -732,8 +715,7 @@ noce_try_store_flag (if_info) ...@@ -732,8 +715,7 @@ noce_try_store_flag (if_info)
/* Convert "if (test) x = a; else x = b", for A and B constant. */ /* Convert "if (test) x = a; else x = b", for A and B constant. */
static int static int
noce_try_store_flag_constants (if_info) noce_try_store_flag_constants (struct noce_if_info *if_info)
struct noce_if_info *if_info;
{ {
rtx target, seq; rtx target, seq;
int reversep; int reversep;
...@@ -783,7 +765,7 @@ noce_try_store_flag_constants (if_info) ...@@ -783,7 +765,7 @@ noce_try_store_flag_constants (if_info)
return FALSE; return FALSE;
if (reversep) if (reversep)
{ {
tmp = itrue; itrue = ifalse; ifalse = tmp; tmp = itrue; itrue = ifalse; ifalse = tmp;
diff = trunc_int_for_mode (-diff, mode); diff = trunc_int_for_mode (-diff, mode);
} }
...@@ -861,12 +843,11 @@ noce_try_store_flag_constants (if_info) ...@@ -861,12 +843,11 @@ noce_try_store_flag_constants (if_info)
return FALSE; return FALSE;
} }
/* Convert "if (test) foo++" into "foo += (test != 0)", and /* Convert "if (test) foo++" into "foo += (test != 0)", and
similarly for "foo--". */ similarly for "foo--". */
static int static int
noce_try_addcc (if_info) noce_try_addcc (struct noce_if_info *if_info)
struct noce_if_info *if_info;
{ {
rtx target, seq; rtx target, seq;
int subtract, normalize; int subtract, normalize;
...@@ -907,7 +888,7 @@ noce_try_addcc (if_info) ...@@ -907,7 +888,7 @@ noce_try_addcc (if_info)
} }
end_sequence (); end_sequence ();
} }
/* If that fails, construct conditional increment or decrement using /* If that fails, construct conditional increment or decrement using
setcc. */ setcc. */
if (BRANCH_COST >= 2 if (BRANCH_COST >= 2
...@@ -958,8 +939,7 @@ noce_try_addcc (if_info) ...@@ -958,8 +939,7 @@ noce_try_addcc (if_info)
/* Convert "if (test) x = 0;" to "x &= -(test == 0);" */ /* Convert "if (test) x = 0;" to "x &= -(test == 0);" */
static int static int
noce_try_store_flag_mask (if_info) noce_try_store_flag_mask (struct noce_if_info *if_info)
struct noce_if_info *if_info;
{ {
rtx target, seq; rtx target, seq;
int reversep; int reversep;
...@@ -1011,10 +991,8 @@ noce_try_store_flag_mask (if_info) ...@@ -1011,10 +991,8 @@ noce_try_store_flag_mask (if_info)
/* Helper function for noce_try_cmove and noce_try_cmove_arith. */ /* Helper function for noce_try_cmove and noce_try_cmove_arith. */
static rtx static rtx
noce_emit_cmove (if_info, x, code, cmp_a, cmp_b, vfalse, vtrue) noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
struct noce_if_info *if_info; rtx cmp_a, rtx cmp_b, rtx vfalse, rtx vtrue)
rtx x, cmp_a, cmp_b, vfalse, vtrue;
enum rtx_code code;
{ {
/* If earliest == jump, try to build the cmove insn directly. /* If earliest == jump, try to build the cmove insn directly.
This is helpful when combine has created some complex condition 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) ...@@ -1057,7 +1035,7 @@ noce_emit_cmove (if_info, x, code, cmp_a, cmp_b, vfalse, vtrue)
#else #else
/* We'll never get here, as noce_process_if_block doesn't call the /* We'll never get here, as noce_process_if_block doesn't call the
functions involved. Ifdef code, however, should be discouraged 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. */ emit_conditional_move won't exist either. */
return NULL_RTX; return NULL_RTX;
#endif #endif
...@@ -1068,8 +1046,7 @@ noce_emit_cmove (if_info, x, code, cmp_a, cmp_b, vfalse, vtrue) ...@@ -1068,8 +1046,7 @@ noce_emit_cmove (if_info, x, code, cmp_a, cmp_b, vfalse, vtrue)
has had a go at it. */ has had a go at it. */
static int static int
noce_try_cmove (if_info) noce_try_cmove (struct noce_if_info *if_info)
struct noce_if_info *if_info;
{ {
enum rtx_code code; enum rtx_code code;
rtx target, seq; rtx target, seq;
...@@ -1109,8 +1086,7 @@ noce_try_cmove (if_info) ...@@ -1109,8 +1086,7 @@ noce_try_cmove (if_info)
/* Try more complex cases involving conditional_move. */ /* Try more complex cases involving conditional_move. */
static int static int
noce_try_cmove_arith (if_info) noce_try_cmove_arith (struct noce_if_info *if_info)
struct noce_if_info *if_info;
{ {
rtx a = if_info->a; rtx a = if_info->a;
rtx b = if_info->b; rtx b = if_info->b;
...@@ -1146,7 +1122,7 @@ noce_try_cmove_arith (if_info) ...@@ -1146,7 +1122,7 @@ noce_try_cmove_arith (if_info)
if (test) if (test)
x = y; x = y;
*/ */
code = GET_CODE (if_info->cond); code = GET_CODE (if_info->cond);
insn_a = if_info->insn_a; insn_a = if_info->insn_a;
insn_b = if_info->insn_b; insn_b = if_info->insn_b;
...@@ -1172,7 +1148,7 @@ noce_try_cmove_arith (if_info) ...@@ -1172,7 +1148,7 @@ noce_try_cmove_arith (if_info)
/* If either operand is complex, load it into a register first. /* 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 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. */ This is of course not possible in the IS_MEM case. */
if (! general_operand (a, GET_MODE (a))) if (! general_operand (a, GET_MODE (a)))
{ {
...@@ -1268,10 +1244,8 @@ noce_try_cmove_arith (if_info) ...@@ -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. */ For these we wish to know that it is A or B in the condition. */
static rtx static rtx
noce_get_alt_condition (if_info, target, earliest) noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
struct noce_if_info *if_info; rtx *earliest)
rtx target;
rtx *earliest;
{ {
rtx cond, set, insn; rtx cond, set, insn;
int reverse; int reverse;
...@@ -1417,9 +1391,8 @@ noce_get_alt_condition (if_info, target, earliest) ...@@ -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. */ /* Convert "if (a < b) x = a; else x = b;" to "x = min(a, b);", etc. */
static int static int
noce_try_minmax (if_info) noce_try_minmax (struct noce_if_info *if_info)
struct noce_if_info *if_info; {
{
rtx cond, earliest, target, seq; rtx cond, earliest, target, seq;
enum rtx_code code, op; enum rtx_code code, op;
int unsignedp; int unsignedp;
...@@ -1502,7 +1475,7 @@ noce_try_minmax (if_info) ...@@ -1502,7 +1475,7 @@ noce_try_minmax (if_info)
noce_emit_move_insn (if_info->x, target); noce_emit_move_insn (if_info->x, target);
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
if (seq_contains_jump (seq)) if (seq_contains_jump (seq))
return FALSE; return FALSE;
...@@ -1517,9 +1490,8 @@ noce_try_minmax (if_info) ...@@ -1517,9 +1490,8 @@ noce_try_minmax (if_info)
/* Convert "if (a < 0) x = -a; else x = a;" to "x = abs(a);", etc. */ /* Convert "if (a < 0) x = -a; else x = a;" to "x = abs(a);", etc. */
static int static int
noce_try_abs (if_info) noce_try_abs (struct noce_if_info *if_info)
struct noce_if_info *if_info; {
{
rtx cond, earliest, target, seq, a, b, c; rtx cond, earliest, target, seq, a, b, c;
int negate; int negate;
...@@ -1539,7 +1511,7 @@ noce_try_abs (if_info) ...@@ -1539,7 +1511,7 @@ noce_try_abs (if_info)
} }
else else
return FALSE; return FALSE;
cond = noce_get_alt_condition (if_info, b, &earliest); cond = noce_get_alt_condition (if_info, b, &earliest);
if (!cond) if (!cond)
return FALSE; return FALSE;
...@@ -1560,7 +1532,7 @@ noce_try_abs (if_info) ...@@ -1560,7 +1532,7 @@ noce_try_abs (if_info)
for (insn = earliest; for (insn = earliest;
insn != if_info->test_bb->head; insn != if_info->test_bb->head;
insn = PREV_INSN (insn)) 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_EQUAL, c))
|| (note = find_reg_note (insn, REG_EQUIV, c)))) || (note = find_reg_note (insn, REG_EQUIV, c))))
break; break;
...@@ -1574,7 +1546,7 @@ noce_try_abs (if_info) ...@@ -1574,7 +1546,7 @@ noce_try_abs (if_info)
c = get_pool_constant (XEXP (c, 0)); c = get_pool_constant (XEXP (c, 0));
/* Work around funny ideas get_condition has wrt canonicalization. /* 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. */ therefore imply integer comparisons. */
if (c == constm1_rtx && GET_CODE (cond) == GT) if (c == constm1_rtx && GET_CODE (cond) == GT)
; ;
...@@ -1620,7 +1592,7 @@ noce_try_abs (if_info) ...@@ -1620,7 +1592,7 @@ noce_try_abs (if_info)
noce_emit_move_insn (if_info->x, target); noce_emit_move_insn (if_info->x, target);
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
if (seq_contains_jump (seq)) if (seq_contains_jump (seq))
return FALSE; return FALSE;
...@@ -1636,9 +1608,7 @@ noce_try_abs (if_info) ...@@ -1636,9 +1608,7 @@ noce_try_abs (if_info)
valid at JUMP, instead of at EARLIEST. */ valid at JUMP, instead of at EARLIEST. */
static rtx static rtx
noce_get_condition (jump, earliest) noce_get_condition (rtx jump, rtx *earliest)
rtx jump;
rtx *earliest;
{ {
rtx cond, set, tmp, insn; rtx cond, set, tmp, insn;
bool reverse; bool reverse;
...@@ -1704,8 +1674,7 @@ noce_get_condition (jump, earliest) ...@@ -1704,8 +1674,7 @@ noce_get_condition (jump, earliest)
/* Return true if OP is ok for if-then-else processing. */ /* Return true if OP is ok for if-then-else processing. */
static int static int
noce_operand_ok (op) noce_operand_ok (rtx op)
rtx op;
{ {
/* We special-case memories, so handle any of them with /* We special-case memories, so handle any of them with
no address side effects. */ no address side effects. */
...@@ -1723,8 +1692,7 @@ noce_operand_ok (op) ...@@ -1723,8 +1692,7 @@ noce_operand_ok (op)
successful at converting the block. */ successful at converting the block. */
static int static int
noce_process_if_block (ce_info) noce_process_if_block (struct ce_if_block * ce_info)
struct ce_if_block * ce_info;
{ {
basic_block test_bb = ce_info->test_bb; /* test block */ basic_block test_bb = ce_info->test_bb; /* test block */
basic_block then_bb = ce_info->then_bb; /* THEN */ basic_block then_bb = ce_info->then_bb; /* THEN */
...@@ -1824,7 +1792,7 @@ noce_process_if_block (ce_info) ...@@ -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 /* 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 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 noce_emit_move_insn expands to more than one insn, so disable the
optimization entirely for now if there are side effects. */ optimization entirely for now if there are side effects. */
if (side_effects_p (x)) if (side_effects_p (x))
...@@ -1890,7 +1858,7 @@ noce_process_if_block (ce_info) ...@@ -1890,7 +1858,7 @@ noce_process_if_block (ce_info)
x must be executed twice. */ x must be executed twice. */
else if (insn_b && side_effects_p (orig_x)) else if (insn_b && side_effects_p (orig_x))
return FALSE; return FALSE;
x = orig_x; x = orig_x;
goto success; goto success;
} }
...@@ -1958,8 +1926,7 @@ noce_process_if_block (ce_info) ...@@ -1958,8 +1926,7 @@ noce_process_if_block (ce_info)
straight line code. Return true if successful. */ straight line code. Return true if successful. */
static int static int
process_if_block (ce_info) process_if_block (struct ce_if_block * ce_info)
struct ce_if_block * ce_info;
{ {
if (! reload_completed if (! reload_completed
&& noce_process_if_block (ce_info)) && noce_process_if_block (ce_info))
...@@ -1989,8 +1956,7 @@ process_if_block (ce_info) ...@@ -1989,8 +1956,7 @@ process_if_block (ce_info)
/* Merge the blocks and mark for local life update. */ /* Merge the blocks and mark for local life update. */
static void static void
merge_if_block (ce_info) merge_if_block (struct ce_if_block * ce_info)
struct ce_if_block * ce_info;
{ {
basic_block test_bb = ce_info->test_bb; /* last test block */ basic_block test_bb = ce_info->test_bb; /* last test block */
basic_block then_bb = ce_info->then_bb; /* THEN */ basic_block then_bb = ce_info->then_bb; /* THEN */
...@@ -2009,7 +1975,7 @@ merge_if_block (ce_info) ...@@ -2009,7 +1975,7 @@ merge_if_block (ce_info)
basic_block bb = test_bb; basic_block bb = test_bb;
basic_block last_test_bb = ce_info->last_test_bb; basic_block last_test_bb = ce_info->last_test_bb;
basic_block fallthru = block_fallthru (bb); basic_block fallthru = block_fallthru (bb);
do do
{ {
bb = fallthru; bb = fallthru;
...@@ -2088,7 +2054,7 @@ merge_if_block (ce_info) ...@@ -2088,7 +2054,7 @@ merge_if_block (ce_info)
Since we've already merged the TEST, THEN and ELSE blocks, we should 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 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 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). */ back up (as with a call to abort). */
else if ((join_bb->pred == NULL else if ((join_bb->pred == NULL
|| join_bb->pred->pred_next == NULL) || join_bb->pred->pred_next == NULL)
...@@ -2128,9 +2094,7 @@ merge_if_block (ce_info) ...@@ -2128,9 +2094,7 @@ merge_if_block (ce_info)
first block if some transformation was done. Return NULL otherwise. */ first block if some transformation was done. Return NULL otherwise. */
static basic_block static basic_block
find_if_header (test_bb, pass) find_if_header (basic_block test_bb, int pass)
basic_block test_bb;
int pass;
{ {
ce_if_block_t ce_info; ce_if_block_t ce_info;
edge then_edge; edge then_edge;
...@@ -2200,9 +2164,7 @@ find_if_header (test_bb, pass) ...@@ -2200,9 +2164,7 @@ find_if_header (test_bb, pass)
of non-note, non-jump, non-USE/CLOBBER insns in the block. */ of non-note, non-jump, non-USE/CLOBBER insns in the block. */
static int static int
block_jumps_and_fallthru_p (cur_bb, target_bb) block_jumps_and_fallthru_p (basic_block cur_bb, basic_block target_bb)
basic_block cur_bb;
basic_block target_bb;
{ {
edge cur_edge; edge cur_edge;
int fallthru_p = FALSE; int fallthru_p = FALSE;
...@@ -2271,8 +2233,7 @@ block_jumps_and_fallthru_p (cur_bb, target_bb) ...@@ -2271,8 +2233,7 @@ block_jumps_and_fallthru_p (cur_bb, target_bb)
Return TRUE if we were successful at converting the block. */ Return TRUE if we were successful at converting the block. */
static int static int
find_if_block (ce_info) find_if_block (struct ce_if_block * ce_info)
struct ce_if_block * ce_info;
{ {
basic_block test_bb = ce_info->test_bb; basic_block test_bb = ce_info->test_bb;
basic_block then_bb = ce_info->then_bb; basic_block then_bb = ce_info->then_bb;
...@@ -2308,7 +2269,7 @@ find_if_block (ce_info) ...@@ -2308,7 +2269,7 @@ find_if_block (ce_info)
} }
else if ((n_insns = block_jumps_and_fallthru_p (bb, then_bb)) >= 0) 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; target_bb = then_bb;
} }
else else
...@@ -2429,7 +2390,7 @@ find_if_block (ce_info) ...@@ -2429,7 +2390,7 @@ find_if_block (ce_info)
/* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */ /* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */
else else
return FALSE; return FALSE;
num_possible_if_blocks++; num_possible_if_blocks++;
...@@ -2491,9 +2452,7 @@ find_if_block (ce_info) ...@@ -2491,9 +2452,7 @@ find_if_block (ce_info)
to a trap, into a conditional trap. */ to a trap, into a conditional trap. */
static int static int
find_cond_trap (test_bb, then_edge, else_edge) find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
basic_block test_bb;
edge then_edge, else_edge;
{ {
basic_block then_bb = then_edge->dest; basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest; basic_block else_bb = else_edge->dest;
...@@ -2589,12 +2548,11 @@ find_cond_trap (test_bb, then_edge, else_edge) ...@@ -2589,12 +2548,11 @@ find_cond_trap (test_bb, then_edge, else_edge)
return TRUE; 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. */ return it. */
static rtx static rtx
block_has_only_trap (bb) block_has_only_trap (basic_block bb)
basic_block bb;
{ {
rtx trap; rtx trap;
...@@ -2694,9 +2652,7 @@ block_has_only_trap (bb) ...@@ -2694,9 +2652,7 @@ block_has_only_trap (bb)
/* Tests for case 1 above. */ /* Tests for case 1 above. */
static int static int
find_if_case_1 (test_bb, then_edge, else_edge) find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
basic_block test_bb;
edge then_edge, else_edge;
{ {
basic_block then_bb = then_edge->dest; basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest, new_bb; basic_block else_bb = else_edge->dest, new_bb;
...@@ -2730,7 +2686,7 @@ find_if_case_1 (test_bb, then_edge, else_edge) ...@@ -2730,7 +2686,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
return FALSE; return FALSE;
/* Registers set are dead, or are predicable. */ /* 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)) then_bb->succ->dest, 1))
return FALSE; return FALSE;
...@@ -2740,7 +2696,7 @@ find_if_case_1 (test_bb, then_edge, else_edge) ...@@ -2740,7 +2696,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
bitmap_operation (test_bb->global_live_at_end, bitmap_operation (test_bb->global_live_at_end,
else_bb->global_live_at_start, else_bb->global_live_at_start,
then_bb->global_live_at_end, BITMAP_IOR); then_bb->global_live_at_end, BITMAP_IOR);
new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb); new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb);
then_bb_index = then_bb->index; then_bb_index = then_bb->index;
if (post_dominators) if (post_dominators)
...@@ -2768,9 +2724,7 @@ find_if_case_1 (test_bb, then_edge, else_edge) ...@@ -2768,9 +2724,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
/* Test for case 2 above. */ /* Test for case 2 above. */
static int static int
find_if_case_2 (test_bb, then_edge, else_edge) find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
basic_block test_bb;
edge then_edge, else_edge;
{ {
basic_block then_bb = then_edge->dest; basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest; basic_block else_bb = else_edge->dest;
...@@ -2798,7 +2752,7 @@ find_if_case_2 (test_bb, then_edge, else_edge) ...@@ -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) if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2)
; ;
else if (else_succ->dest->index < 0 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_succ->dest))
; ;
else else
...@@ -2824,7 +2778,7 @@ find_if_case_2 (test_bb, then_edge, else_edge) ...@@ -2824,7 +2778,7 @@ find_if_case_2 (test_bb, then_edge, else_edge)
bitmap_operation (test_bb->global_live_at_end, bitmap_operation (test_bb->global_live_at_end,
then_bb->global_live_at_start, then_bb->global_live_at_start,
else_bb->global_live_at_end, BITMAP_IOR); else_bb->global_live_at_end, BITMAP_IOR);
if (post_dominators) if (post_dominators)
delete_from_dominance_info (post_dominators, else_bb); delete_from_dominance_info (post_dominators, else_bb);
delete_block (else_bb); delete_block (else_bb);
...@@ -2842,9 +2796,7 @@ find_if_case_2 (test_bb, then_edge, else_edge) ...@@ -2842,9 +2796,7 @@ find_if_case_2 (test_bb, then_edge, else_edge)
Return 1 if a memory is found. */ Return 1 if a memory is found. */
static int static int
find_memory (px, data) find_memory (rtx *px, void *data ATTRIBUTE_UNUSED)
rtx *px;
void *data ATTRIBUTE_UNUSED;
{ {
return GET_CODE (*px) == MEM; return GET_CODE (*px) == MEM;
} }
...@@ -2858,10 +2810,8 @@ find_memory (px, data) ...@@ -2858,10 +2810,8 @@ find_memory (px, data)
REVERSEP is true if the sense of the branch should be reversed. */ REVERSEP is true if the sense of the branch should be reversed. */
static int static int
dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep) dead_or_predicable (basic_block test_bb, basic_block merge_bb,
basic_block test_bb, merge_bb, other_bb; basic_block other_bb, basic_block new_dest, int reversep)
basic_block new_dest;
int reversep;
{ {
rtx head, end, jump, earliest, old_dest, new_label = NULL_RTX; 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) ...@@ -2986,7 +2936,7 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
test_set = INITIALIZE_REG_SET (test_set_head); test_set = INITIALIZE_REG_SET (test_set_head);
/* ??? bb->local_set is only valid during calculate_global_regs_live, /* ??? 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. */ since we've already asserted that MERGE_BB is small. */
propagate_block (merge_bb, tmp, merge_set, merge_set, 0); 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) ...@@ -3117,8 +3067,7 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
/* Main entry point for all if-conversion. */ /* Main entry point for all if-conversion. */
void void
if_convert (x_life_data_ok) if_convert (int x_life_data_ok)
int x_life_data_ok;
{ {
basic_block bb; basic_block bb;
int pass; int pass;
......
...@@ -25,7 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -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. */ /* The data structure used to record a location in a translation unit. */
struct location_s GTY (()) struct location_s GTY (())
{ {
/* The name of the source file involved. */ /* The name of the source file involved. */
const char *file; const char *file;
/* The line-location in the source file. */ /* The line-location in the source file. */
...@@ -53,7 +53,7 @@ extern struct file_stack *input_file_stack; ...@@ -53,7 +53,7 @@ extern struct file_stack *input_file_stack;
/* Incremented on each change to input_file_stack. */ /* Incremented on each change to input_file_stack. */
extern int input_file_stack_tick; extern int input_file_stack_tick;
extern void push_srcloc PARAMS ((const char *name, int line)); extern void push_srcloc (const char *name, int line);
extern void pop_srcloc PARAMS ((void)); extern void pop_srcloc (void);
#endif #endif
...@@ -74,28 +74,23 @@ typedef struct initial_value_struct GTY(()) { ...@@ -74,28 +74,23 @@ typedef struct initial_value_struct GTY(()) {
initial_value_pair * GTY ((length ("%h.num_entries"))) entries; initial_value_pair * GTY ((length ("%h.num_entries"))) entries;
} initial_value_struct; } 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 rtvec initialize_for_inline (tree);
static void integrate_parm_decls PARAMS ((tree, struct inline_remap *, static void note_modified_parmregs (rtx, rtx, void *);
rtvec)); static void integrate_parm_decls (tree, struct inline_remap *, rtvec);
static tree integrate_decl_tree PARAMS ((tree, static tree integrate_decl_tree (tree, struct inline_remap *);
struct inline_remap *)); static void subst_constants (rtx *, rtx, struct inline_remap *, int);
static void subst_constants PARAMS ((rtx *, rtx, static void set_block_origin_self (tree);
struct inline_remap *, int)); static void set_block_abstract_flags (tree, int);
static void set_block_origin_self PARAMS ((tree)); static void process_reg_param (struct inline_remap *, rtx, rtx);
static void set_block_abstract_flags PARAMS ((tree, int)); static void mark_stores (rtx, rtx, void *);
static void process_reg_param PARAMS ((struct inline_remap *, rtx, static void save_parm_insns (rtx, rtx);
rtx)); static void copy_insn_list (rtx, struct inline_remap *, rtx);
static void mark_stores PARAMS ((rtx, rtx, void *)); static void copy_insn_notes (rtx, struct inline_remap *, int);
static void save_parm_insns PARAMS ((rtx, rtx)); static int compare_blocks (const void *, const void *);
static void copy_insn_list PARAMS ((rtx, struct inline_remap *, static int find_block (const void *, const void *);
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 *));
/* Used by copy_rtx_and_substitute; this indicates whether the function is /* 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 called for the purpose of inlining or some other purpose (i.e. loop
...@@ -109,9 +104,7 @@ static struct function *inlining = 0; ...@@ -109,9 +104,7 @@ static struct function *inlining = 0;
explosions when the label_map gets very large. */ explosions when the label_map gets very large. */
rtx rtx
get_label_from_map (map, i) get_label_from_map (struct inline_remap *map, int i)
struct inline_remap *map;
int i;
{ {
rtx x = map->label_map[i]; rtx x = map->label_map[i];
...@@ -124,8 +117,7 @@ get_label_from_map (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 /* Return false if the function FNDECL cannot be inlined on account of its
attributes, true otherwise. */ attributes, true otherwise. */
bool bool
function_attribute_inlinable_p (fndecl) function_attribute_inlinable_p (tree fndecl)
tree fndecl;
{ {
if (targetm.attribute_table) if (targetm.attribute_table)
{ {
...@@ -151,8 +143,7 @@ function_attribute_inlinable_p (fndecl) ...@@ -151,8 +143,7 @@ function_attribute_inlinable_p (fndecl)
for the function's name. */ for the function's name. */
const char * const char *
function_cannot_inline_p (fndecl) function_cannot_inline_p (tree fndecl)
tree fndecl;
{ {
rtx insn; rtx insn;
tree last = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fndecl))); tree last = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
...@@ -285,8 +276,7 @@ static int in_nonparm_insns; ...@@ -285,8 +276,7 @@ static int in_nonparm_insns;
needed to save FNDECL's insns and info for future inline expansion. */ needed to save FNDECL's insns and info for future inline expansion. */
static rtvec static rtvec
initialize_for_inline (fndecl) initialize_for_inline (tree fndecl)
tree fndecl;
{ {
int i; int i;
rtvec arg_vector; rtvec arg_vector;
...@@ -337,10 +327,7 @@ initialize_for_inline (fndecl) ...@@ -337,10 +327,7 @@ initialize_for_inline (fndecl)
TO_FN. */ TO_FN. */
tree tree
copy_decl_for_inlining (decl, from_fn, to_fn) copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn)
tree decl;
tree from_fn;
tree to_fn;
{ {
tree copy; tree copy;
...@@ -441,8 +428,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn) ...@@ -441,8 +428,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
functions at the end of compilation. */ functions at the end of compilation. */
void void
save_for_inline (fndecl) save_for_inline (tree fndecl)
tree fndecl;
{ {
rtx insn; rtx insn;
rtvec argvec; rtvec argvec;
...@@ -518,9 +504,7 @@ save_for_inline (fndecl) ...@@ -518,9 +504,7 @@ save_for_inline (fndecl)
register and track the new register's life. */ register and track the new register's life. */
static void static void
save_parm_insns (insn, first_nonparm_insn) save_parm_insns (rtx insn, rtx first_nonparm_insn)
rtx insn;
rtx first_nonparm_insn;
{ {
if (insn == NULL_RTX) if (insn == NULL_RTX)
return; return;
...@@ -554,10 +538,7 @@ save_parm_insns (insn, first_nonparm_insn) ...@@ -554,10 +538,7 @@ save_parm_insns (insn, first_nonparm_insn)
/* Note whether a parameter is modified or not. */ /* Note whether a parameter is modified or not. */
static void static void
note_modified_parmregs (reg, x, data) note_modified_parmregs (rtx reg, rtx x ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED)
rtx reg;
rtx x ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (reg) == REG && in_nonparm_insns if (GET_CODE (reg) == REG && in_nonparm_insns
&& REGNO (reg) < max_parm_reg && REGNO (reg) < max_parm_reg
...@@ -588,9 +569,7 @@ varray_type global_const_equiv_varray; ...@@ -588,9 +569,7 @@ varray_type global_const_equiv_varray;
Also, don't allow hard registers here; they might not be valid when Also, don't allow hard registers here; they might not be valid when
substituted into insns. */ substituted into insns. */
static void static void
process_reg_param (map, loc, copy) process_reg_param (struct inline_remap *map, rtx loc, rtx copy)
struct inline_remap *map;
rtx loc, copy;
{ {
if ((GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG) if ((GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG)
|| (GET_CODE (copy) == REG && REG_USERVAR_P (loc) || (GET_CODE (copy) == REG && REG_USERVAR_P (loc)
...@@ -612,9 +591,7 @@ process_reg_param (map, loc, copy) ...@@ -612,9 +591,7 @@ process_reg_param (map, loc, copy)
two pointers, because it may overflow sizeof(int). */ two pointers, because it may overflow sizeof(int). */
static int static int
compare_blocks (v1, v2) compare_blocks (const void *v1, const void *v2)
const void *v1;
const void *v2;
{ {
tree b1 = *((const tree *) v1); tree b1 = *((const tree *) v1);
tree b2 = *((const tree *) v2); tree b2 = *((const tree *) v2);
...@@ -630,9 +607,7 @@ compare_blocks (v1, v2) ...@@ -630,9 +607,7 @@ compare_blocks (v1, v2)
an original block; the second to a remapped equivalent. */ an original block; the second to a remapped equivalent. */
static int static int
find_block (v1, v2) find_block (const void *v1, const void *v2)
const void *v1;
const void *v2;
{ {
const union tree_node *b1 = (const union tree_node *) v1; const union tree_node *b1 = (const union tree_node *) v1;
tree b2 = *((const tree *) v2); tree b2 = *((const tree *) v2);
...@@ -658,13 +633,8 @@ find_block (v1, v2) ...@@ -658,13 +633,8 @@ find_block (v1, v2)
else an rtx for where the value is stored. */ else an rtx for where the value is stored. */
rtx rtx
expand_inline_function (fndecl, parms, target, ignore, type, expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
structure_value_addr) tree type, rtx structure_value_addr)
tree fndecl, parms;
rtx target;
int ignore;
tree type;
rtx structure_value_addr;
{ {
struct function *inlining_previous; struct function *inlining_previous;
struct function *inl_f = DECL_SAVED_INSNS (fndecl); struct function *inl_f = DECL_SAVED_INSNS (fndecl);
...@@ -812,10 +782,10 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -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 /* 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 end up here with an rtx wrongly tagged unchanging in the caller's
context. Fix that. */ 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) && (GET_CODE (arg_vals[i]) == REG || GET_CODE (arg_vals[i]) == MEM)
&& ! TREE_READONLY (TREE_VALUE (actual))) && ! TREE_READONLY (TREE_VALUE (actual)))
RTX_UNCHANGING_P (arg_vals[i]) = 0; RTX_UNCHANGING_P (arg_vals[i]) = 0;
if (arg_vals[i] != 0 if (arg_vals[i] != 0
&& (! TREE_READONLY (formal) && (! TREE_READONLY (formal)
...@@ -1039,7 +1009,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -1039,7 +1009,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
REG_FUNCTION_RETURN_VALUE_P. */ REG_FUNCTION_RETURN_VALUE_P. */
map->inline_target = 0; 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); ? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
if (TYPE_MODE (type) == VOIDmode) if (TYPE_MODE (type) == VOIDmode)
...@@ -1348,10 +1318,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -1348,10 +1318,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
register for the function. */ register for the function. */
static void static void
copy_insn_list (insns, map, static_chain_value) copy_insn_list (rtx insns, struct inline_remap *map, rtx static_chain_value)
rtx insns;
struct inline_remap *map;
rtx static_chain_value;
{ {
int i; int i;
rtx insn; rtx insn;
...@@ -1732,10 +1699,7 @@ copy_insn_list (insns, map, static_chain_value) ...@@ -1732,10 +1699,7 @@ copy_insn_list (insns, map, static_chain_value)
that are valid across the entire function. */ that are valid across the entire function. */
static void static void
copy_insn_notes (insns, map, eh_region_offset) copy_insn_notes (rtx insns, struct inline_remap *map, int eh_region_offset)
rtx insns;
struct inline_remap *map;
int eh_region_offset;
{ {
rtx insn, new_insn; rtx insn, new_insn;
...@@ -1791,10 +1755,7 @@ copy_insn_notes (insns, map, eh_region_offset) ...@@ -1791,10 +1755,7 @@ copy_insn_notes (insns, map, eh_region_offset)
push all of those decls and give each one the corresponding home. */ push all of those decls and give each one the corresponding home. */
static void static void
integrate_parm_decls (args, map, arg_vector) integrate_parm_decls (tree args, struct inline_remap *map, rtvec arg_vector)
tree args;
struct inline_remap *map;
rtvec arg_vector;
{ {
tree tail; tree tail;
int i; int i;
...@@ -1827,9 +1788,7 @@ integrate_parm_decls (args, map, arg_vector) ...@@ -1827,9 +1788,7 @@ integrate_parm_decls (args, map, arg_vector)
no mapping is necessary. */ no mapping is necessary. */
static tree static tree
integrate_decl_tree (let, map) integrate_decl_tree (tree let, struct inline_remap *map)
tree let;
struct inline_remap *map;
{ {
tree t; tree t;
tree new_block; tree new_block;
...@@ -1898,10 +1857,7 @@ integrate_decl_tree (let, map) ...@@ -1898,10 +1857,7 @@ integrate_decl_tree (let, map)
calling `force_const_mem'. */ calling `force_const_mem'. */
rtx rtx
copy_rtx_and_substitute (orig, map, for_lhs) copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs)
rtx orig;
struct inline_remap *map;
int for_lhs;
{ {
rtx copy, temp; rtx copy, temp;
int i, j; int i, j;
...@@ -2050,7 +2006,7 @@ copy_rtx_and_substitute (orig, map, for_lhs) ...@@ -2050,7 +2006,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
{ {
if (!map->leaf_reg_map[regno][mode]) if (!map->leaf_reg_map[regno][mode])
map->leaf_reg_map[regno][mode] = gen_rtx_REG (mode, regno); 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 #endif
else else
...@@ -2280,7 +2236,7 @@ copy_rtx_and_substitute (orig, map, for_lhs) ...@@ -2280,7 +2236,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
MEM_COPY_ATTRIBUTES (copy, XEXP (orig, 0)); MEM_COPY_ATTRIBUTES (copy, XEXP (orig, 0));
return return
gen_rtx_CALL (GET_MODE (orig), copy, gen_rtx_CALL (GET_MODE (orig), copy,
copy_rtx_and_substitute (XEXP (orig, 1), map, 0)); copy_rtx_and_substitute (XEXP (orig, 1), map, 0));
} }
break; break;
...@@ -2447,9 +2403,7 @@ copy_rtx_and_substitute (orig, map, for_lhs) ...@@ -2447,9 +2403,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
/* Substitute known constant values into INSN, if that is valid. */ /* Substitute known constant values into INSN, if that is valid. */
void void
try_constants (insn, map) try_constants (rtx insn, struct inline_remap *map)
rtx insn;
struct inline_remap *map;
{ {
int i; int i;
...@@ -2463,7 +2417,7 @@ try_constants (insn, map) ...@@ -2463,7 +2417,7 @@ try_constants (insn, map)
apply_change_group (); apply_change_group ();
subst_constants (&PATTERN (insn), insn, map, 0); subst_constants (&PATTERN (insn), insn, map, 0);
apply_change_group (); apply_change_group ();
/* Enforce consistency between the addresses in the regular insn flow /* Enforce consistency between the addresses in the regular insn flow
and the ones in CALL_INSN_FUNCTION_USAGE lists, if any. */ and the ones in CALL_INSN_FUNCTION_USAGE lists, if any. */
if (GET_CODE (insn) == CALL_INSN && CALL_INSN_FUNCTION_USAGE (insn)) if (GET_CODE (insn) == CALL_INSN && CALL_INSN_FUNCTION_USAGE (insn))
...@@ -2521,11 +2475,7 @@ try_constants (insn, map) ...@@ -2521,11 +2475,7 @@ try_constants (insn, map)
If MEMONLY is nonzero, only make changes inside a MEM. */ If MEMONLY is nonzero, only make changes inside a MEM. */
static void static void
subst_constants (loc, insn, map, memonly) subst_constants (rtx *loc, rtx insn, struct inline_remap *map, int memonly)
rtx *loc;
rtx insn;
struct inline_remap *map;
int memonly;
{ {
rtx x = *loc; rtx x = *loc;
int i, j; int i, j;
...@@ -2599,7 +2549,7 @@ subst_constants (loc, insn, map, memonly) ...@@ -2599,7 +2549,7 @@ subst_constants (loc, insn, map, memonly)
integral mode and extracting the low part. */ integral mode and extracting the low part. */
subst_constants (&inner, NULL_RTX, map, 0); subst_constants (&inner, NULL_RTX, map, 0);
new = simplify_gen_subreg (GET_MODE (x), inner, new = simplify_gen_subreg (GET_MODE (x), inner,
GET_MODE (SUBREG_REG (x)), GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x)); SUBREG_BYTE (x));
if (new) if (new)
...@@ -2856,10 +2806,7 @@ subst_constants (loc, insn, map, memonly) ...@@ -2856,10 +2806,7 @@ subst_constants (loc, insn, map, memonly)
called from note_stores with parts of the new insn. */ called from note_stores with parts of the new insn. */
static void static void
mark_stores (dest, x, data) mark_stores (rtx dest, rtx x ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED)
rtx dest;
rtx x ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
{ {
int regno = -1; int regno = -1;
enum machine_mode mode = VOIDmode; enum machine_mode mode = VOIDmode;
...@@ -2908,8 +2855,7 @@ mark_stores (dest, x, data) ...@@ -2908,8 +2855,7 @@ mark_stores (dest, x, data)
values to point to themselves. */ values to point to themselves. */
static void static void
set_block_origin_self (stmt) set_block_origin_self (tree stmt)
tree stmt;
{ {
if (BLOCK_ABSTRACT_ORIGIN (stmt) == NULL_TREE) if (BLOCK_ABSTRACT_ORIGIN (stmt) == NULL_TREE)
{ {
...@@ -2947,8 +2893,7 @@ set_block_origin_self (stmt) ...@@ -2947,8 +2893,7 @@ set_block_origin_self (stmt)
point to themselves. */ point to themselves. */
void void
set_decl_origin_self (decl) set_decl_origin_self (tree decl)
tree decl;
{ {
if (DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE) if (DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE)
{ {
...@@ -2972,9 +2917,7 @@ set_decl_origin_self (decl) ...@@ -2972,9 +2917,7 @@ set_decl_origin_self (decl)
(recursively) which are contained therein. */ (recursively) which are contained therein. */
static void static void
set_block_abstract_flags (stmt, setting) set_block_abstract_flags (tree stmt, int setting)
tree stmt;
int setting;
{ {
tree local_decl; tree local_decl;
tree subblock; tree subblock;
...@@ -2999,9 +2942,7 @@ set_block_abstract_flags (stmt, setting) ...@@ -2999,9 +2942,7 @@ set_block_abstract_flags (stmt, setting)
blocks and sub-blocks (recursively) to the same setting. */ blocks and sub-blocks (recursively) to the same setting. */
void void
set_decl_abstract_flags (decl, setting) set_decl_abstract_flags (tree decl, int setting)
tree decl;
int setting;
{ {
DECL_ABSTRACT (decl) = setting; DECL_ABSTRACT (decl) = setting;
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
...@@ -3023,8 +2964,7 @@ set_decl_abstract_flags (decl, setting) ...@@ -3023,8 +2964,7 @@ set_decl_abstract_flags (decl, setting)
static GTY(()) struct function *old_cfun; static GTY(()) struct function *old_cfun;
void void
output_inline_function (fndecl) output_inline_function (tree fndecl)
tree fndecl;
{ {
enum debug_info_type old_write_symbols = write_symbols; enum debug_info_type old_write_symbols = write_symbols;
const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks; const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks;
...@@ -3067,9 +3007,7 @@ output_inline_function (fndecl) ...@@ -3067,9 +3007,7 @@ output_inline_function (fndecl)
the function. */ the function. */
rtx rtx
get_hard_reg_initial_reg (fun, reg) get_hard_reg_initial_reg (struct function *fun, rtx reg)
struct function *fun;
rtx reg;
{ {
struct initial_value_struct *ivs = fun->hard_reg_initial_vals; struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
int i; int i;
...@@ -3085,9 +3023,7 @@ get_hard_reg_initial_reg (fun, reg) ...@@ -3085,9 +3023,7 @@ get_hard_reg_initial_reg (fun, reg)
} }
rtx rtx
has_func_hard_reg_initial_val (fun, reg) has_func_hard_reg_initial_val (struct function *fun, rtx reg)
struct function *fun;
rtx reg;
{ {
struct initial_value_struct *ivs = fun->hard_reg_initial_vals; struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
int i; int i;
...@@ -3103,9 +3039,7 @@ has_func_hard_reg_initial_val (fun, reg) ...@@ -3103,9 +3039,7 @@ has_func_hard_reg_initial_val (fun, reg)
} }
rtx rtx
get_func_hard_reg_initial_val (fun, reg) get_func_hard_reg_initial_val (struct function *fun, rtx reg)
struct function *fun;
rtx reg;
{ {
struct initial_value_struct *ivs = fun->hard_reg_initial_vals; struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
rtx rv = has_func_hard_reg_initial_val (fun, reg); rtx rv = has_func_hard_reg_initial_val (fun, reg);
...@@ -3125,7 +3059,7 @@ get_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) if (ivs->num_entries >= ivs->max_entries)
{ {
ivs->max_entries += 5; ivs->max_entries += 5;
ivs->entries = ivs->entries =
(initial_value_pair *) ggc_realloc (ivs->entries, (initial_value_pair *) ggc_realloc (ivs->entries,
ivs->max_entries ivs->max_entries
* sizeof (initial_value_pair)); * sizeof (initial_value_pair));
...@@ -3138,25 +3072,19 @@ get_func_hard_reg_initial_val (fun, reg) ...@@ -3138,25 +3072,19 @@ get_func_hard_reg_initial_val (fun, reg)
} }
rtx rtx
get_hard_reg_initial_val (mode, regno) get_hard_reg_initial_val (enum machine_mode mode, int regno)
enum machine_mode mode;
int regno;
{ {
return get_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno)); return get_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno));
} }
rtx rtx
has_hard_reg_initial_val (mode, regno) has_hard_reg_initial_val (enum machine_mode mode, int regno)
enum machine_mode mode;
int regno;
{ {
return has_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno)); return has_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno));
} }
static void static void
setup_initial_hard_reg_value_integration (inl_f, remap) setup_initial_hard_reg_value_integration (struct function *inl_f, struct inline_remap *remap)
struct function *inl_f;
struct inline_remap *remap;
{ {
struct initial_value_struct *ivs = inl_f->hard_reg_initial_vals; struct initial_value_struct *ivs = inl_f->hard_reg_initial_vals;
int i; int i;
...@@ -3171,7 +3099,7 @@ setup_initial_hard_reg_value_integration (inl_f, remap) ...@@ -3171,7 +3099,7 @@ setup_initial_hard_reg_value_integration (inl_f, remap)
void void
emit_initial_value_sets () emit_initial_value_sets (void)
{ {
struct initial_value_struct *ivs = cfun->hard_reg_initial_vals; struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;
int i; int i;
...@@ -3192,8 +3120,7 @@ emit_initial_value_sets () ...@@ -3192,8 +3120,7 @@ emit_initial_value_sets ()
/* If the backend knows where to allocate pseudos for hard /* If the backend knows where to allocate pseudos for hard
register initial values, register these allocations now. */ register initial values, register these allocations now. */
void void
allocate_initial_values (reg_equiv_memory_loc) allocate_initial_values (rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED)
rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED;
{ {
#ifdef ALLOCATE_INITIAL_VALUE #ifdef ALLOCATE_INITIAL_VALUE
struct initial_value_struct *ivs = cfun->hard_reg_initial_vals; struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;
......
/* Function integration definitions for GCC /* 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. This file is part of GCC.
...@@ -112,7 +113,7 @@ struct inline_remap ...@@ -112,7 +113,7 @@ struct inline_remap
rtx dest; rtx dest;
rtx equiv; rtx equiv;
} equiv_sets[MAX_RECOG_OPERANDS]; } 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. */ conditional branch insns. */
rtx last_pc_value; rtx last_pc_value;
#ifdef HAVE_cc0 #ifdef HAVE_cc0
...@@ -127,41 +128,41 @@ struct inline_remap ...@@ -127,41 +128,41 @@ struct inline_remap
/* Return a copy of an rtx (as needed), substituting pseudo-register, /* Return a copy of an rtx (as needed), substituting pseudo-register,
labels, and frame-pointer offsets as necessary. */ 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 /* Return a pseudo that corresponds to the value in the specified hard
reg as of the start of the function (for inlined functions, the reg as of the start of the function (for inlined functions, the
value at the start of the parent function). */ 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 /* Likewise, but for a different than the current function, or
arbitrary expression. */ 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. */ /* 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. */ /* 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 /* If a pseudo represents an initial hard reg (or expression), return
it, else return NULL_RTX. */ 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. */ /* Called from rest_of_compilation. */
extern void emit_initial_value_sets PARAMS ((void)); extern void emit_initial_value_sets (void);
extern void allocate_initial_values PARAMS ((rtx *)); extern void allocate_initial_values (rtx *);
/* Copy a declaration when one function is substituted inline into /* Copy a declaration when one function is substituted inline into
another. */ another. */
extern union tree_node *copy_decl_for_inlining PARAMS ((union tree_node *, extern union tree_node *copy_decl_for_inlining (union tree_node *,
union tree_node *, union tree_node *,
union tree_node *)); union tree_node *);
/* Check whether there's any attribute in a function declaration that /* Check whether there's any attribute in a function declaration that
makes the function uninlinable. Returns false if it finds any, makes the function uninlinable. Returns false if it finds any,
true otherwise. */ 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. */ /* 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. */ /* Set the label indicated. */
#define set_label_in_map(MAP, I, X) ((MAP)->label_map[I] = (X)) #define set_label_in_map(MAP, I, X) ((MAP)->label_map[I] = (X))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment