genrecog.c: Use ISO C90 prototypes.

* genrecog.c: Use ISO C90 prototypes.
	(nodes_identical): Correct declaration to match prototype.
	(maybe_both_true): Likewise.
	(merge_trees): Likewise.

	* genpeep.c (gen_peephole): Remove #if 0 code.
	Use ISO C90 prototypes.

	* genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code.
	Remove #if 0'ed function simplify_by_alternatives.
	(optimize_attrs): Remove #if 0'ed code.
	Remove ^L.
	Use ISO C90 prototypes.
	(make_canonical): Remove #if 0'ed code.
	(convert_const_symbol_ref): Remove #if 0'ed function.

	* gen-protos.c (main): Check for argument.

	* rtl.h: Use ISO C90 prototypes for functions from lists.c.

	* params.h: Use ISO C90 prototypes.
	* params.c: Likewise.
	* intl.c: Likewise.
	* intl.h: Likewise.
	* lists.c: Likewise.
	* errors.c: Likewise.
	* errors.h: Likewise.
	* gencodes.c: Likewise.
	* genpreds.c: Likewise.
	* genattr.c: Likewise.
	* gen-protos.c: Likewise.
	* genflags.c: Likewise
	* genconditions.c: Likewise.
	* genautomata.c: Likewise.
	* gencheck.c: Likewise.
	* genconfig.c: Likewise.
	* genconstants.c: Likewise.
	* genemit.c: Likewise.
	* genextract.c: Likewise.
	* gengenrtl.c: Likewise.
	* gengtype.c: Likewise.
	* gengtype.h: Likewise.
	* genopinit.c: Likewise.
	* genoutput.c: Likewise.
	* gensupport.c: Likewise.
	* gensupport.h: Likewise.

From-SVN: r67296
This commit is contained in:
Andreas Jaeger 2003-06-01 17:59:10 +02:00 committed by Andreas Jaeger
parent a5a88a76ab
commit 3d7aafde11
30 changed files with 1539 additions and 2164 deletions

View File

@ -1,5 +1,52 @@
2003-06-01 Andreas Jaeger <aj@suse.de>
* genrecog.c: Use ISO C90 prototypes.
(nodes_identical): Correct declaration to match prototype.
(maybe_both_true): Likewise.
(merge_trees): Likewise.
* genpeep.c (gen_peephole): Remove #if 0 code.
Use ISO C90 prototypes.
* genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code.
Remove #if 0'ed function simplify_by_alternatives.
(optimize_attrs): Remove #if 0'ed code.
Remove ^L.
Use ISO C90 prototypes.
(make_canonical): Remove #if 0'ed code.
(convert_const_symbol_ref): Remove #if 0'ed function.
* gen-protos.c (main): Check for argument.
* rtl.h: Use ISO C90 prototypes for functions from lists.c.
* params.h: Use ISO C90 prototypes.
* params.c: Likewise.
* intl.c: Likewise.
* intl.h: Likewise.
* lists.c: Likewise.
* errors.c: Likewise.
* errors.h: Likewise.
* gencodes.c: Likewise.
* genpreds.c: Likewise.
* genattr.c: Likewise.
* gen-protos.c: Likewise.
* genflags.c: Likewise
* genconditions.c: Likewise.
* genautomata.c: Likewise.
* gencheck.c: Likewise.
* genconfig.c: Likewise.
* genconstants.c: Likewise.
* genemit.c: Likewise.
* genextract.c: Likewise.
* gengenrtl.c: Likewise.
* gengtype.c: Likewise.
* gengtype.h: Likewise.
* genopinit.c: Likewise.
* genoutput.c: Likewise.
* gensupport.c: Likewise.
* gensupport.h: Likewise.
* sdbout.h: Use ISO C90 prototypes.
* sdbout.c (CONTIN): Removed empty macro.

View File

@ -1,5 +1,6 @@
/* Basic error reporting routines.
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -42,7 +43,7 @@ void
warning (const char *format, ...)
{
va_list ap;
va_start (ap, format);
fprintf (stderr, "%s: warning: ", progname);
vfprintf (stderr, format, ap);
@ -57,7 +58,7 @@ void
error (const char *format, ...)
{
va_list ap;
va_start (ap, format);
fprintf (stderr, "%s: ", progname);
vfprintf (stderr, format, ap);
@ -74,7 +75,7 @@ void
fatal (const char *format, ...)
{
va_list ap;
va_start (ap, format);
fprintf (stderr, "%s: ", progname);
vfprintf (stderr, format, ap);
@ -89,7 +90,7 @@ void
internal_error (const char *format, ...)
{
va_list ap;
va_start (ap, format);
fprintf (stderr, "%s: Internal error: ", progname);
vfprintf (stderr, format, ap);
@ -105,8 +106,7 @@ internal_error (const char *format, ...)
version if for the gen* programs and so needn't handle subdirectories. */
const char *
trim_filename (name)
const char *name;
trim_filename (const char *name)
{
static const char this_file[] = __FILE__;
const char *p = name, *q = this_file;
@ -130,10 +130,7 @@ trim_filename (name)
This file is used only by build programs, so we're not as polite as
the version in diagnostic.c. */
void
fancy_abort (file, line, func)
const char *file;
int line;
const char *func;
fancy_abort (const char *file, int line, const char *func)
{
internal_error ("abort in %s, at %s:%d", func, file, line);
}

View File

@ -1,5 +1,6 @@
/* Basic error reporting routines.
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -29,12 +30,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_ERRORS_H
#define GCC_ERRORS_H
extern void warning PARAMS ((const char *, ...));
extern void error PARAMS ((const char *, ...));
extern void fatal PARAMS ((const char *, ...)) ATTRIBUTE_NORETURN;
extern void internal_error PARAMS ((const char *, ...)) ATTRIBUTE_NORETURN;
extern const char *trim_filename PARAMS ((const char *));
extern void fancy_abort PARAMS ((const char *, int, const char *))
extern void warning (const char *, ...);
extern void error (const char *, ...);
extern void fatal (const char *, ...) ATTRIBUTE_NORETURN;
extern void internal_error (const char *, ...) ATTRIBUTE_NORETURN;
extern const char *trim_filename (const char *);
extern void fancy_abort (const char *, int, const char *)
ATTRIBUTE_NORETURN;
extern int have_error;

View File

@ -1,6 +1,6 @@
/* gen-protos.c - massages a list of prototypes, for use by fixproto.
Copyright (C) 1993, 1994, 1995, 1996, 1998,
1999 Free Software Foundation, Inc.
1999, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@ -26,8 +26,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
int verbose = 0;
const char *progname;
static void add_hash PARAMS ((const char *));
static int parse_fn_proto PARAMS ((char *, char *, struct fn_decl *));
static void add_hash (const char *);
static int parse_fn_proto (char *, char *, struct fn_decl *);
#define HASH_SIZE 2503 /* a prime */
int hash_tab[HASH_SIZE];
@ -35,8 +35,7 @@ int next_index;
int collisions;
static void
add_hash (fname)
const char *fname;
add_hash (const char *fname)
{
int i, i0;
@ -67,9 +66,7 @@ add_hash (fname)
The fields of FN point to the input string. */
static int
parse_fn_proto (start, end, fn)
char *start, *end;
struct fn_decl *fn;
parse_fn_proto (char *start, char *end, struct fn_decl *fn)
{
char *ptr;
int param_nesting = 1;
@ -131,12 +128,8 @@ parse_fn_proto (start, end, fn)
return 1;
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc ATTRIBUTE_UNUSED;
char **argv;
main (int argc, char **argv)
{
FILE *inf = stdin;
FILE *outf = stdout;
@ -144,6 +137,9 @@ main (argc, argv)
sstring linebuf;
struct fn_decl fn_decl;
if (argc <= 1)
fatal ("no input file name");
i = strlen (argv[0]);
while (i > 0 && argv[0][i-1] != '/') --i;
progname = &argv[0][i];
@ -155,7 +151,7 @@ main (argc, argv)
/* A hash table entry of 0 means "unused" so reserve it. */
fprintf (outf, " {\"\", \"\", \"\", 0},\n");
next_index = 1;
for (;;)
{
int c = skip_spaces (inf, ' ');
@ -192,6 +188,6 @@ main (argc, argv)
fprintf (stderr, "gen-protos: %d entries %d collisions\n",
next_index, collisions);
return 0;
}

View File

@ -1,5 +1,6 @@
/* Generate attribute information (insn-attr.h) from machine description.
Copyright (C) 1991, 1994, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1991, 1994, 1996, 1998, 1999, 2000, 2003
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
@ -51,52 +52,46 @@ struct function_unit
struct range issue_delay; /* Range of issue delay values. */
};
static void extend_range PARAMS ((struct range *, int, int));
static void init_range PARAMS ((struct range *));
static void write_upcase PARAMS ((const char *));
static void gen_attr PARAMS ((rtx));
static void write_units PARAMS ((int, struct range *, struct range *,
struct range *, struct range *,
struct range *));
static void extend_range (struct range *, int, int);
static void init_range (struct range *);
static void write_upcase (const char *);
static void gen_attr (rtx);
static void write_units (int, struct range *, struct range *,
struct range *, struct range *,
struct range *);
static void
extend_range (range, min, max)
struct range *range;
int min;
int max;
extend_range (struct range *range, int min, int max)
{
if (range->min > min) range->min = min;
if (range->max < max) range->max = max;
}
static void
init_range (range)
struct range *range;
init_range (struct range *range)
{
range->min = 100000;
range->max = -1;
}
static void
write_upcase (str)
const char *str;
write_upcase (const char *str)
{
for (; *str; str++)
putchar (TOUPPER(*str));
}
static void
gen_attr (attr)
rtx attr;
gen_attr (rtx attr)
{
const char *p, *tag;
int is_const = GET_CODE (XEXP (attr, 2)) == CONST;
int is_const = GET_CODE (XEXP (attr, 2)) == CONST;
printf ("#define HAVE_ATTR_%s\n", XSTR (attr, 0));
/* If numeric attribute, don't need to write an enum. */
p = XSTR (attr, 1);
if (*p == '\0')
printf ("extern int get_attr_%s PARAMS ((%s));\n", XSTR (attr, 0),
printf ("extern int get_attr_%s (%s);\n", XSTR (attr, 0),
(is_const ? "void" : "rtx"));
else
{
@ -113,7 +108,7 @@ gen_attr (attr)
}
fputs ("};\n", stdout);
printf ("extern enum attr_%s get_attr_%s PARAMS ((%s));\n\n",
printf ("extern enum attr_%s get_attr_%s (%s);\n\n",
XSTR (attr, 0), XSTR (attr, 0), (is_const ? "void" : "rtx"));
}
@ -122,29 +117,24 @@ gen_attr (attr)
if (! strcmp (XSTR (attr, 0), "length"))
{
puts ("\
extern void shorten_branches PARAMS ((rtx));\n\
extern int insn_default_length PARAMS ((rtx));\n\
extern int insn_variable_length_p PARAMS ((rtx));\n\
extern int insn_current_length PARAMS ((rtx));\n\n\
extern void shorten_branches (rtx);\n\
extern int insn_default_length (rtx);\n\
extern int insn_variable_length_p (rtx);\n\
extern int insn_current_length (rtx);\n\n\
#include \"insn-addr.h\"\n");
}
}
static void
write_units (num_units, multiplicity, simultaneity,
ready_cost, issue_delay, blockage)
int num_units;
struct range *multiplicity;
struct range *simultaneity;
struct range *ready_cost;
struct range *issue_delay;
struct range *blockage;
write_units (int num_units, struct range *multiplicity, struct range *simultaneity,
struct range *ready_cost, struct range *issue_delay,
struct range *blockage)
{
int i, q_size;
printf ("#define INSN_SCHEDULING\n\n");
printf ("extern int result_ready_cost PARAMS ((rtx));\n");
printf ("extern int function_units_used PARAMS ((rtx));\n\n");
printf ("extern int result_ready_cost (rtx);\n");
printf ("extern int function_units_used (rtx);\n\n");
printf ("extern const struct function_unit_desc\n");
printf ("{\n");
printf (" const char *const name;\n");
@ -153,11 +143,11 @@ write_units (num_units, multiplicity, simultaneity,
printf (" const int simultaneity;\n");
printf (" const int default_cost;\n");
printf (" const int max_issue_delay;\n");
printf (" int (*const ready_cost_function) PARAMS ((rtx));\n");
printf (" int (*const conflict_cost_function) PARAMS ((rtx, rtx));\n");
printf (" int (*const ready_cost_function) (rtx);\n");
printf (" int (*const conflict_cost_function) (rtx, rtx);\n");
printf (" const int max_blockage;\n");
printf (" unsigned int (*const blockage_range_function) PARAMS ((rtx));\n");
printf (" int (*const blockage_function) PARAMS ((rtx, rtx));\n");
printf (" unsigned int (*const blockage_range_function) (rtx);\n");
printf (" int (*const blockage_function) (rtx, rtx);\n");
printf ("} function_units[];\n\n");
printf ("#define FUNCTION_UNITS_SIZE %d\n", num_units);
printf ("#define MIN_MULTIPLICITY %d\n", multiplicity->min);
@ -182,12 +172,8 @@ write_units (num_units, multiplicity, simultaneity,
printf ("#define INSN_QUEUE_SIZE %d\n", q_size);
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
int have_delay = 0;
@ -224,7 +210,7 @@ main (argc, argv)
puts ("#define HAVE_ATTR_alternative");
puts ("#define get_attr_alternative(insn) which_alternative");
/* Read the machine description. */
while (1)
@ -243,9 +229,9 @@ main (argc, argv)
if (! have_delay)
{
printf ("#define DELAY_SLOTS\n");
printf ("extern int num_delay_slots PARAMS ((rtx));\n");
printf ("extern int eligible_for_delay PARAMS ((rtx, int, rtx, int));\n\n");
printf ("extern int const_num_delay_slots PARAMS ((rtx));\n\n");
printf ("extern int num_delay_slots (rtx);\n");
printf ("extern int eligible_for_delay (rtx, int, rtx, int);\n\n");
printf ("extern int const_num_delay_slots (rtx);\n\n");
have_delay = 1;
}
@ -254,14 +240,14 @@ main (argc, argv)
if (XVECEXP (desc, 1, i + 1) && ! have_annul_true)
{
printf ("#define ANNUL_IFTRUE_SLOTS\n");
printf ("extern int eligible_for_annul_true PARAMS ((rtx, int, rtx, int));\n");
printf ("extern int eligible_for_annul_true (rtx, int, rtx, int);\n");
have_annul_true = 1;
}
if (XVECEXP (desc, 1, i + 2) && ! have_annul_false)
{
printf ("#define ANNUL_IFFALSE_SLOTS\n");
printf ("extern int eligible_for_annul_false PARAMS ((rtx, int, rtx, int));\n");
printf ("extern int eligible_for_annul_false (rtx, int, rtx, int);\n");
have_annul_false = 1;
}
}
@ -379,19 +365,19 @@ main (argc, argv)
printf (" same processor cycle. */\n");
printf ("#define MAX_DFA_ISSUE_RATE max_dfa_issue_rate\n\n");
printf ("/* Insn latency time defined in define_insn_reservation. */\n");
printf ("extern int insn_default_latency PARAMS ((rtx));\n\n");
printf ("extern int insn_default_latency (rtx);\n\n");
printf ("/* Return nonzero if there is a bypass for given insn\n");
printf (" which is a data producer. */\n");
printf ("extern int bypass_p PARAMS ((rtx));\n\n");
printf ("extern int bypass_p (rtx);\n\n");
printf ("/* Insn latency time on data consumed by the 2nd insn.\n");
printf (" Use the function if bypass_p returns nonzero for\n");
printf (" the 1st insn. */\n");
printf ("extern int insn_latency PARAMS ((rtx, rtx));\n\n");
printf ("extern int insn_latency (rtx, rtx);\n\n");
printf ("\n#if AUTOMATON_ALTS\n");
printf ("/* The following function returns number of alternative\n");
printf (" reservations of given insn. It may be used for better\n");
printf (" insns scheduling heuristics. */\n");
printf ("extern int insn_alts PARAMS ((rtx));\n\n");
printf ("extern int insn_alts (rtx);\n\n");
printf ("#endif\n\n");
printf ("/* Maximal possible number of insns waiting results being\n");
printf (" produced by insns whose execution is not finished. */\n");
@ -399,10 +385,10 @@ main (argc, argv)
printf ("/* Pointer to data describing current state of DFA. */\n");
printf ("typedef void *state_t;\n\n");
printf ("/* Size of the data in bytes. */\n");
printf ("extern int state_size PARAMS ((void));\n\n");
printf ("extern int state_size (void);\n\n");
printf ("/* Initiate given DFA state, i.e. Set up the state\n");
printf (" as all functional units were not reserved. */\n");
printf ("extern void state_reset PARAMS ((state_t));\n");
printf ("extern void state_reset (state_t);\n");
printf ("/* The following function returns negative value if given\n");
printf (" insn can be issued in processor state described by given\n");
printf (" DFA state. In this case, the DFA state is changed to\n");
@ -412,7 +398,7 @@ main (argc, argv)
printf (" for superscalar or VLIW processors. If the second\n");
printf (" parameter is NULL the function changes given DFA state\n");
printf (" as new processor cycle started. */\n");
printf ("extern int state_transition PARAMS ((state_t, rtx));\n");
printf ("extern int state_transition (state_t, rtx);\n");
printf ("\n#if AUTOMATON_STATE_ALTS\n");
printf ("/* The following function returns number of possible\n");
printf (" alternative reservations of given insn in given\n");
@ -420,12 +406,12 @@ main (argc, argv)
printf (" heuristics. By default the function is defined if\n");
printf (" macro AUTOMATON_STATE_ALTS is defined because its\n");
printf (" implementation may require much memory. */\n");
printf ("extern int state_alts PARAMS ((state_t, rtx));\n");
printf ("extern int state_alts (state_t, rtx);\n");
printf ("#endif\n\n");
printf ("extern int min_issue_delay PARAMS ((state_t, rtx));\n");
printf ("extern int min_issue_delay (state_t, rtx);\n");
printf ("/* The following function returns nonzero if no one insn\n");
printf (" can be issued in current DFA state. */\n");
printf ("extern int state_dead_lock_p PARAMS ((state_t));\n");
printf ("extern int state_dead_lock_p (state_t);\n");
printf ("/* The function returns minimal delay of issue of the 2nd\n");
printf (" insn after issuing the 1st insn in given DFA state.\n");
printf (" The 1st insn should be issued in given state (i.e.\n");
@ -433,30 +419,30 @@ main (argc, argv)
printf (" the insn and the state). Data dependencies between\n");
printf (" the insns are ignored by the function. */\n");
printf
("extern int min_insn_conflict_delay PARAMS ((state_t, rtx, rtx));\n");
("extern int min_insn_conflict_delay (state_t, rtx, rtx);\n");
printf ("/* The following function outputs reservations for given\n");
printf (" insn as they are described in the corresponding\n");
printf (" define_insn_reservation. */\n");
printf ("extern void print_reservation PARAMS ((FILE *, rtx));\n");
printf ("extern void print_reservation (FILE *, rtx);\n");
printf ("\n#if CPU_UNITS_QUERY\n");
printf ("/* The following function returns code of functional unit\n");
printf (" with given name (see define_cpu_unit). */\n");
printf ("extern int get_cpu_unit_code PARAMS ((const char *));\n");
printf ("extern int get_cpu_unit_code (const char *);\n");
printf ("/* The following function returns nonzero if functional\n");
printf (" unit with given code is currently reserved in given\n");
printf (" DFA state. */\n");
printf ("extern int cpu_unit_reservation_p PARAMS ((state_t, int));\n");
printf ("extern int cpu_unit_reservation_p (state_t, int);\n");
printf ("#endif\n\n");
printf ("/* Clean insn code cache. It should be called if there\n");
printf (" is a chance that condition value in a\n");
printf (" define_insn_reservation will be changed after\n");
printf (" last call of dfa_start. */\n");
printf ("extern void dfa_clean_insn_cache PARAMS ((void));\n\n");
printf ("extern void dfa_clean_insn_cache (void);\n\n");
printf ("/* Initiate and finish work with DFA. They should be\n");
printf (" called as the first and the last interface\n");
printf (" functions. */\n");
printf ("extern void dfa_start PARAMS ((void));\n");
printf ("extern void dfa_finish PARAMS ((void));\n");
printf ("extern void dfa_start (void);\n");
printf ("extern void dfa_finish (void);\n");
}
else
{
@ -465,7 +451,7 @@ main (argc, argv)
printf ("typedef void *state_t;\n\n");
}
/* Output flag masks for use by reorg.
/* Output flag masks for use by reorg.
Flags are used to hold branch direction and prediction information
for use by eligible_for_... */
@ -486,8 +472,7 @@ main (argc, argv)
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code ATTRIBUTE_UNUSED;
get_insn_name (int code ATTRIBUTE_UNUSED)
{
return NULL;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
/* Generate check macros for tree codes.
Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -32,20 +33,16 @@ static const char *const tree_codes[] = {
(char*) 0
};
static void usage PARAMS ((void));
static void usage (void);
static void
usage ()
usage (void)
{
fputs ("Usage: gencheck\n", stderr);
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv ATTRIBUTE_UNUSED;
main (int argc, char **argv ATTRIBUTE_UNUSED)
{
int i;

View File

@ -2,7 +2,7 @@
- some macros CODE_FOR_... giving the insn_code_number value
for each of the defined standard insn names.
Copyright (C) 1987, 1991, 1995, 1998,
1999, 2000, 2001 Free Software Foundation, Inc.
1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -30,12 +30,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "errors.h"
#include "gensupport.h"
static void gen_insn PARAMS ((rtx, int));
static void
gen_insn (insn, code)
rtx insn;
int code;
gen_insn (rtx insn, int code)
{
const char *name = XSTR (insn, 0);
int truth = maybe_eval_c_test (XSTR (insn, 2));
@ -52,12 +48,8 @@ gen_insn (insn, code)
}
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
@ -111,8 +103,7 @@ enum insn_code {");
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code ATTRIBUTE_UNUSED;
get_insn_name (int code ATTRIBUTE_UNUSED)
{
return NULL;
}

View File

@ -1,5 +1,5 @@
/* Process machine description and calculate constant conditions.
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -40,20 +40,17 @@ static int saw_eh_return;
static htab_t condition_table;
static void add_condition PARAMS ((const char *));
static void write_header PARAMS ((void));
static void write_conditions PARAMS ((void));
static int write_one_condition PARAMS ((PTR *, PTR));
extern int main PARAMS ((int, char **));
static void add_condition (const char *);
static void write_header (void);
static void write_conditions (void);
static int write_one_condition (void **, void *);
/* Record the C test expression EXPR in the condition_table.
Duplicates clobber previous entries, which leaks memory, but
we don't care for this application. */
static void
add_condition (expr)
const char *expr;
add_condition (const char *expr)
{
struct c_test *test;
@ -69,7 +66,7 @@ add_condition (expr)
/* Generate the header for insn-conditions.c. */
static void
write_header ()
write_header (void)
{
puts ("\
/* Generated automatically by the program `genconditions' from the target\n\
@ -122,7 +119,7 @@ write_header ()
extern rtx insn;\n\
extern rtx ins1;\n\
extern rtx operands[];\n\
extern int next_insn_tests_no_inequality PARAMS ((rtx));\n");
extern int next_insn_tests_no_inequality (rtx);\n");
puts ("\
/* If we don't have __builtin_constant_p, or it's not acceptable in\n\
@ -142,9 +139,7 @@ extern int next_insn_tests_no_inequality PARAMS ((rtx));\n");
MAYBE_EVAL (! optimize_size && ! TARGET_READ_MODIFY_WRITE) }, */
static int
write_one_condition (slot, dummy)
PTR *slot;
PTR dummy ATTRIBUTE_UNUSED;
write_one_condition (void **slot, void *dummy ATTRIBUTE_UNUSED)
{
const struct c_test *test = * (const struct c_test **) slot;
const char *p;
@ -167,7 +162,7 @@ write_one_condition (slot, dummy)
/* Write out the complete conditions table, its size, and a flag
indicating that gensupport.c can now do insn elision. */
static void
write_conditions ()
write_conditions (void)
{
puts ("\
/* This table lists each condition found in the machine description.\n\
@ -186,9 +181,7 @@ const struct c_test insn_conditions[] = {");
}
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
int pattern_lineno; /* not used */

View File

@ -1,7 +1,7 @@
/* Generate from machine description:
- some #define configuration flags.
Copyright (C) 1987, 1991, 1997, 1998,
1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1987, 1991, 1997, 1998, 1999, 2000, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -50,12 +50,12 @@ static int max_insns_per_peep2;
static int clobbers_seen_this_insn;
static int dup_operands_seen_this_insn;
static void walk_insn_part PARAMS ((rtx, int, int));
static void gen_insn PARAMS ((rtx));
static void gen_expand PARAMS ((rtx));
static void gen_split PARAMS ((rtx));
static void gen_peephole PARAMS ((rtx));
static void gen_peephole2 PARAMS ((rtx));
static void walk_insn_part (rtx, int, int);
static void gen_insn (rtx);
static void gen_expand (rtx);
static void gen_split (rtx);
static void gen_peephole (rtx);
static void gen_peephole2 (rtx);
/* RECOG_P will be nonzero if this pattern was seen in a context where it will
be used to recognize, rather than just generate an insn.
@ -64,10 +64,7 @@ static void gen_peephole2 PARAMS ((rtx));
of a SET whose destination is not (pc). */
static void
walk_insn_part (part, recog_p, non_pc_set_src)
rtx part;
int recog_p;
int non_pc_set_src;
walk_insn_part (rtx part, int recog_p, int non_pc_set_src)
{
int i, j;
RTX_CODE code;
@ -171,8 +168,7 @@ walk_insn_part (part, recog_p, non_pc_set_src)
}
static void
gen_insn (insn)
rtx insn;
gen_insn (rtx insn)
{
int i;
@ -192,8 +188,7 @@ gen_insn (insn)
/* Similar but scan a define_expand. */
static void
gen_expand (insn)
rtx insn;
gen_expand (rtx insn)
{
int i;
@ -219,8 +214,7 @@ gen_expand (insn)
/* Similar but scan a define_split. */
static void
gen_split (split)
rtx split;
gen_split (rtx split)
{
int i;
@ -234,8 +228,7 @@ gen_split (split)
}
static void
gen_peephole (peep)
rtx peep;
gen_peephole (rtx peep)
{
int i;
@ -246,8 +239,7 @@ gen_peephole (peep)
}
static void
gen_peephole2 (peep)
rtx peep;
gen_peephole2 (rtx peep)
{
int i, n;
@ -265,12 +257,8 @@ gen_peephole2 (peep)
max_insns_per_peep2 = n;
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
@ -379,8 +367,7 @@ main (argc, argv)
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code ATTRIBUTE_UNUSED;
get_insn_name (int code ATTRIBUTE_UNUSED)
{
return NULL;
}

View File

@ -2,8 +2,8 @@
a series of #define statements, one for each constant named in
a (define_constants ...) pattern.
Copyright (C) 1987, 1991, 1995, 1998,
1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1987, 1991, 1995, 1998, 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -34,16 +34,13 @@ Boston, MA 02111-1307, USA. */
#include "errors.h"
#include "gensupport.h"
static int print_md_constant PARAMS ((void **, void *));
extern int main PARAMS ((int, char **));
static int print_md_constant (void **, void *);
/* Called via traverse_md_constants; emit a #define for
the current constant definition. */
static int
print_md_constant (slot, info)
void **slot;
void *info;
print_md_constant (void **slot, void *info)
{
struct md_constant *def = *slot;
FILE *file = info;
@ -53,9 +50,7 @@ print_md_constant (slot, info)
}
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
int dummy1, dummy2;
rtx desc;

View File

@ -1,6 +1,6 @@
/* Generate code from machine description to emit insns as rtl.
Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -37,7 +37,7 @@ static int insn_code_number;
static int insn_index_number;
/* Data structure for recording the patterns of insns that have CLOBBERs.
We use this to output a function that adds these CLOBBERs to a
We use this to output a function that adds these CLOBBERs to a
previously-allocated PARALLEL expression. */
struct clobber_pat
@ -57,22 +57,21 @@ struct clobber_ent
struct clobber_ent *next;
};
static void max_operand_1 PARAMS ((rtx));
static int max_operand_vec PARAMS ((rtx, int));
static void print_code PARAMS ((RTX_CODE));
static void gen_exp PARAMS ((rtx, enum rtx_code, char *));
static void gen_insn PARAMS ((rtx, int));
static void gen_expand PARAMS ((rtx));
static void gen_split PARAMS ((rtx));
static void output_add_clobbers PARAMS ((void));
static void output_added_clobbers_hard_reg_p PARAMS ((void));
static void gen_rtx_scratch PARAMS ((rtx, enum rtx_code));
static void output_peephole2_scratches PARAMS ((rtx));
static void max_operand_1 (rtx);
static int max_operand_vec (rtx, int);
static void print_code (RTX_CODE);
static void gen_exp (rtx, enum rtx_code, char *);
static void gen_insn (rtx, int);
static void gen_expand (rtx);
static void gen_split (rtx);
static void output_add_clobbers (void);
static void output_added_clobbers_hard_reg_p (void);
static void gen_rtx_scratch (rtx, enum rtx_code);
static void output_peephole2_scratches (rtx);
static void
max_operand_1 (x)
rtx x;
max_operand_1 (rtx x)
{
RTX_CODE code;
int i;
@ -112,9 +111,7 @@ max_operand_1 (x)
}
static int
max_operand_vec (insn, arg)
rtx insn;
int arg;
max_operand_vec (rtx insn, int arg)
{
int len = XVECLEN (insn, arg);
int i;
@ -130,8 +127,7 @@ max_operand_vec (insn, arg)
}
static void
print_code (code)
RTX_CODE code;
print_code (RTX_CODE code)
{
const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
@ -139,9 +135,7 @@ print_code (code)
}
static void
gen_rtx_scratch (x, subroutine_type)
rtx x;
enum rtx_code subroutine_type;
gen_rtx_scratch (rtx x, enum rtx_code subroutine_type)
{
if (subroutine_type == DEFINE_PEEPHOLE2)
{
@ -157,10 +151,7 @@ gen_rtx_scratch (x, subroutine_type)
substituting any operand references appearing within. */
static void
gen_exp (x, subroutine_type, used)
rtx x;
enum rtx_code subroutine_type;
char *used;
gen_exp (rtx x, enum rtx_code subroutine_type, char *used)
{
RTX_CODE code;
int i;
@ -294,14 +285,12 @@ gen_exp (x, subroutine_type, used)
abort ();
}
printf (")");
}
}
/* Generate the `gen_...' function for a DEFINE_INSN. */
static void
gen_insn (insn, lineno)
rtx insn;
int lineno;
gen_insn (rtx insn, int lineno)
{
int operands;
int i;
@ -349,7 +338,7 @@ gen_insn (insn, lineno)
rtx new = XEXP (XVECEXP (insn, 1, j), 0);
/* OLD and NEW are the same if both are to be a SCRATCH
of the same mode,
of the same mode,
or if both are registers of the same mode and number. */
if (! (GET_MODE (old) == GET_MODE (new)
&& ((GET_CODE (old) == MATCH_SCRATCH
@ -358,7 +347,7 @@ gen_insn (insn, lineno)
&& REGNO (old) == REGNO (new)))))
break;
}
if (j == XVECLEN (insn, 1))
break;
}
@ -366,7 +355,7 @@ gen_insn (insn, lineno)
if (p == 0)
{
p = (struct clobber_pat *) xmalloc (sizeof (struct clobber_pat));
p->insns = 0;
p->pattern = insn;
p->first_clobber = i + 1;
@ -432,8 +421,7 @@ gen_insn (insn, lineno)
/* Generate the `gen_...' function for a DEFINE_EXPAND. */
static void
gen_expand (expand)
rtx expand;
gen_expand (rtx expand)
{
int operands;
int i;
@ -569,8 +557,7 @@ gen_expand (expand)
/* Like gen_expand, but generates insns resulting from splitting SPLIT. */
static void
gen_split (split)
rtx split;
gen_split (rtx split)
{
int i;
int operands;
@ -596,7 +583,7 @@ gen_split (split)
/* Output the prototype, function name and argument declarations. */
if (GET_CODE (split) == DEFINE_PEEPHOLE2)
{
printf ("extern rtx gen_%s_%d PARAMS ((rtx, rtx *));\n",
printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
name, insn_code_number);
printf ("rtx\ngen_%s_%d (curr_insn, operands)\n",
name, insn_code_number);
@ -605,7 +592,7 @@ gen_split (split)
}
else
{
printf ("extern rtx gen_split_%d PARAMS ((rtx *));\n", insn_code_number);
printf ("extern rtx gen_split_%d (rtx *);\n", insn_code_number);
printf ("rtx\ngen_%s_%d (operands)\n", name, insn_code_number);
printf (" rtx *operands%s;\n", unused);
}
@ -724,7 +711,7 @@ output_add_clobbers ()
hard reg and 0 if they just clobber SCRATCH. */
static void
output_added_clobbers_hard_reg_p ()
output_added_clobbers_hard_reg_p (void)
{
struct clobber_pat *clobber;
struct clobber_ent *ent;
@ -761,8 +748,7 @@ output_added_clobbers_hard_reg_p ()
scratch registers used by the peephole2 pattern in SPLIT. */
static void
output_peephole2_scratches (split)
rtx split;
output_peephole2_scratches (rtx split)
{
int i;
int insn_nr = 0;
@ -788,7 +774,7 @@ output_peephole2_scratches (split)
cur_insn_nr++;
printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
return NULL;\n",
return NULL;\n",
XINT (elt, 0),
insn_nr, last_insn_nr,
XSTR (elt, 1),
@ -800,12 +786,8 @@ output_peephole2_scratches (split)
}
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
@ -896,8 +878,7 @@ from the machine description file `md'. */\n\n");
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code ATTRIBUTE_UNUSED;
get_insn_name (int code ATTRIBUTE_UNUSED)
{
return NULL;
}

View File

@ -1,6 +1,6 @@
/* Generate code from machine description to extract operands from insn as rtl.
Copyright (C) 1987, 1991, 1992, 1993, 1997, 1998,
1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1987, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* This structure contains all the information needed to describe one
set of extractions methods. Each method may be used by more than
set of extractions methods. Each method may be used by more than
one pattern if the operands are in the same place.
The string for each operand describes that path to the operand and
@ -95,14 +95,13 @@ static int dupnums[MAX_DUP_OPERANDS];
static struct code_ptr *peepholes;
static void gen_insn PARAMS ((rtx));
static void walk_rtx PARAMS ((rtx, const char *));
static void print_path PARAMS ((const char *));
static void record_insn_name PARAMS ((int, const char *));
static void gen_insn (rtx);
static void walk_rtx (rtx, const char *);
static void print_path (const char *);
static void record_insn_name (int, const char *);
static void
gen_insn (insn)
rtx insn;
gen_insn (rtx insn)
{
int i;
struct extraction *p;
@ -181,9 +180,7 @@ gen_insn (insn)
}
static void
walk_rtx (x, path)
rtx x;
const char *path;
walk_rtx (rtx x, const char *path)
{
RTX_CODE code;
int i;
@ -222,11 +219,11 @@ walk_rtx (x, path)
duplocs[dup_count] = xstrdup (path);
dupnums[dup_count] = XINT (x, 0);
dup_count++;
newpath = (char *) xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
for (i = XVECLEN (x, 1) - 1; i >= 0; i--)
{
newpath[depth] = (code == MATCH_OP_DUP ? '0' : 'a') + i;
@ -234,7 +231,7 @@ walk_rtx (x, path)
}
free (newpath);
return;
case MATCH_OPERATOR:
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
@ -306,8 +303,7 @@ walk_rtx (x, path)
evaluate to the rtx at that point. */
static void
print_path (path)
const char *path;
print_path (const char *path)
{
int len = strlen (path);
int i;
@ -332,7 +328,7 @@ print_path (path)
else
abort ();
}
printf ("pat");
for (i = 0; i < len; i++)
@ -346,12 +342,9 @@ print_path (path)
}
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
int i;
@ -458,7 +451,7 @@ from the machine description file `md'. */\n\n");
else
printf (" case %d:\n", i);
}
for (i = 0; i < p->op_count; i++)
{
if (p->oplocs[i] == 0)
@ -522,7 +515,7 @@ record_insn_name (code, name)
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr =
(char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0,
memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
}
@ -537,6 +530,6 @@ record_insn_name (code, name)
last_real_name = new = xstrdup (name);
last_real_code = code;
}
insn_name_ptr[code] = new;
}
}

View File

@ -2,7 +2,7 @@
- some flags HAVE_... saying which simple standard instructions are
available for this machine.
Copyright (C) 1987, 1991, 1995, 1998,
1999, 2000 Free Software Foundation, Inc.
1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -40,17 +40,16 @@ static int max_id_len;
/* Max operand encountered in a scan over some insn. */
static int max_opno;
static void max_operand_1 PARAMS ((rtx));
static int num_operands PARAMS ((rtx));
static void gen_proto PARAMS ((rtx));
static void gen_macro PARAMS ((const char *, int, int));
static void gen_insn PARAMS ((rtx));
static void max_operand_1 (rtx);
static int num_operands (rtx);
static void gen_proto (rtx);
static void gen_macro (const char *, int, int);
static void gen_insn (rtx);
/* Count the number of match_operand's found. */
static void
max_operand_1 (x)
rtx x;
max_operand_1 (rtx x)
{
RTX_CODE code;
int i;
@ -82,8 +81,7 @@ max_operand_1 (x)
}
static int
num_operands (insn)
rtx insn;
num_operands (rtx insn)
{
int len = XVECLEN (insn, 1);
int i;
@ -100,9 +98,7 @@ num_operands (insn)
of arguments it takes. Any missing arguments are assumed to be at
the end. */
static void
gen_macro (name, real, expect)
const char *name;
int real, expect;
gen_macro (const char *name, int real, int expect)
{
int i;
@ -131,8 +127,7 @@ gen_macro (name, real, expect)
does nothing. */
static void
gen_proto (insn)
rtx insn;
gen_proto (rtx insn)
{
int num = num_operands (insn);
int i;
@ -159,9 +154,9 @@ gen_proto (insn)
}
if (truth != 0)
printf ("extern rtx gen_%-*s PARAMS ((", max_id_len, name);
printf ("extern rtx gen_%-*s (", max_id_len, name);
else
printf ("static inline rtx gen_%-*s PARAMS ((", max_id_len, name);
printf ("static inline rtx gen_%-*s (", max_id_len, name);
if (num == 0)
fputs ("void", stdout);
@ -169,11 +164,11 @@ gen_proto (insn)
{
for (i = 1; i < num; i++)
fputs ("rtx, ", stdout);
fputs ("rtx", stdout);
}
puts ("));");
puts (");");
/* Some back ends want to take the address of generator functions,
so we cannot simply use #define for these dummy definitions. */
@ -197,8 +192,7 @@ gen_proto (insn)
}
static void
gen_insn (insn)
rtx insn;
gen_insn (rtx insn)
{
const char *name = XSTR (insn, 0);
const char *p;
@ -238,12 +232,8 @@ gen_insn (insn)
obstack_grow (&obstack, &insn, sizeof (rtx));
}
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
rtx dummy;
@ -262,7 +252,7 @@ main (argc, argv)
if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
return (FATAL_EXIT_CODE);
puts ("/* Generated automatically by the program `genflags'");
puts (" from the machine description file `md'. */\n");
puts ("#ifndef GCC_INSN_FLAGS_H");
@ -299,8 +289,7 @@ main (argc, argv)
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code ATTRIBUTE_UNUSED;
get_insn_name (int code ATTRIBUTE_UNUSED)
{
return NULL;
}

View File

@ -1,5 +1,6 @@
/* Generate code to allocate RTL structures.
Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -44,24 +45,23 @@ static const struct rtx_definition defs[] =
static const char *formats[NUM_RTX_CODE];
static const char *type_from_format PARAMS ((int));
static const char *accessor_from_format PARAMS ((int));
static int special_format PARAMS ((const char *));
static int special_rtx PARAMS ((int));
static int excluded_rtx PARAMS ((int));
static void find_formats PARAMS ((void));
static void gendecl PARAMS ((const char *));
static void genmacro PARAMS ((int));
static void gendef PARAMS ((const char *));
static void genlegend PARAMS ((void));
static void genheader PARAMS ((void));
static void gencode PARAMS ((void));
static const char *type_from_format (int);
static const char *accessor_from_format (int);
static int special_format (const char *);
static int special_rtx (int);
static int excluded_rtx (int);
static void find_formats (void);
static void gendecl (const char *);
static void genmacro (int);
static void gendef (const char *);
static void genlegend (void);
static void genheader (void);
static void gencode (void);
/* Decode a format letter into a C type string. */
static const char *
type_from_format (c)
int c;
type_from_format (int c)
{
switch (c)
{
@ -93,8 +93,7 @@ type_from_format (c)
/* Decode a format letter into the proper accessor function. */
static const char *
accessor_from_format (c)
int c;
accessor_from_format (int c)
{
switch (c)
{
@ -131,8 +130,7 @@ accessor_from_format (c)
the list of formats we write routines to create. */
static int
special_format (fmt)
const char *fmt;
special_format (const char *fmt)
{
return (strchr (fmt, '*') != 0
|| strchr (fmt, 'V') != 0
@ -145,8 +143,7 @@ special_format (fmt)
is a wrapper in emit-rtl.c). */
static int
special_rtx (idx)
int idx;
special_rtx (int idx)
{
return (strcmp (defs[idx].enumname, "CONST_INT") == 0
|| strcmp (defs[idx].enumname, "REG") == 0
@ -160,8 +157,7 @@ special_rtx (idx)
cannot have the obvious interface). */
static int
excluded_rtx (idx)
int idx;
excluded_rtx (int idx)
{
return (strcmp (defs[idx].enumname, "CONST_DOUBLE") == 0);
}
@ -169,7 +165,7 @@ excluded_rtx (idx)
/* Place a list of all format specifiers we use into the array FORMAT. */
static void
find_formats ()
find_formats (void)
{
int i;
@ -192,13 +188,12 @@ find_formats ()
/* Write the declarations for the routine to allocate RTL with FORMAT. */
static void
gendecl (format)
const char *format;
gendecl (const char *format)
{
const char *p;
int i, pos;
printf ("extern rtx gen_rtx_fmt_%s\tPARAMS ((RTX_CODE, ", format);
printf ("extern rtx gen_rtx_fmt_%s\t (RTX_CODE, ", format);
printf ("enum machine_mode mode");
/* Write each parameter that is needed and start a new line when the line
@ -216,15 +211,14 @@ gendecl (format)
pos += ourlen;
}
printf ("));\n");
printf (");\n");
}
/* Generate macros to generate RTL of code IDX using the functions we
write. */
static void
genmacro (idx)
int idx;
genmacro (int idx)
{
const char *p;
int i;
@ -257,8 +251,7 @@ genmacro (idx)
format is FORMAT. */
static void
gendef (format)
const char *format;
gendef (const char *format)
{
const char *p;
int i, j;
@ -298,7 +291,7 @@ gendef (format)
/* Generate the documentation header for files we write. */
static void
genlegend ()
genlegend (void)
{
puts ("/* Generated automatically by gengenrtl from rtl.def. */\n");
}
@ -306,7 +299,7 @@ genlegend ()
/* Generate the text of the header file we make, genrtl.h. */
static void
genheader ()
genheader (void)
{
int i;
const char **fmt;
@ -329,7 +322,7 @@ genheader ()
/* Generate the text of the code file we write, genrtl.c. */
static void
gencode ()
gencode (void)
{
const char **fmt;
@ -348,12 +341,9 @@ gencode ()
/* This is the main program. We accept only one argument, "-h", which
says we are writing the genrtl.h file. Otherwise we are writing the
genrtl.c file. */
extern int main PARAMS ((int, char **));
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
find_formats ();
genlegend ();

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Process source files and output type information.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -111,36 +111,36 @@ extern struct fileloc lexer_line;
/* Print an error message. */
extern void error_at_line
PARAMS ((struct fileloc *pos, const char *msg, ...)) ATTRIBUTE_PRINTF_2;
(struct fileloc *pos, const char *msg, ...) ATTRIBUTE_PRINTF_2;
/* Combines xmalloc() and vasprintf(). */
extern int xvasprintf PARAMS ((char **, const char *, va_list))
extern int xvasprintf (char **, const char *, va_list)
ATTRIBUTE_PRINTF (2, 0);
/* Like the above, but more convenient for quick coding. */
extern char * xasprintf PARAMS ((const char *, ...))
extern char * xasprintf (const char *, ...)
ATTRIBUTE_PRINTF_1;
/* Constructor routines for types. */
extern void do_typedef PARAMS ((const char *s, type_p t, struct fileloc *pos));
extern type_p resolve_typedef PARAMS ((const char *s, struct fileloc *pos));
extern void new_structure PARAMS ((const char *name, int isunion,
struct fileloc *pos, pair_p fields,
options_p o));
extern type_p find_structure PARAMS ((const char *s, int isunion));
extern type_p create_scalar_type PARAMS ((const char *name, size_t name_len));
extern type_p create_pointer PARAMS ((type_p t));
extern type_p create_array PARAMS ((type_p t, const char *len));
extern type_p adjust_field_type PARAMS ((type_p, options_p));
extern void note_variable PARAMS ((const char *s, type_p t, options_p o,
struct fileloc *pos));
extern void note_yacc_type PARAMS ((options_p o, pair_p fields,
pair_p typeinfo, struct fileloc *pos));
extern void do_typedef (const char *s, type_p t, struct fileloc *pos);
extern type_p resolve_typedef (const char *s, struct fileloc *pos);
extern void new_structure (const char *name, int isunion,
struct fileloc *pos, pair_p fields,
options_p o);
extern type_p find_structure (const char *s, int isunion);
extern type_p create_scalar_type (const char *name, size_t name_len);
extern type_p create_pointer (type_p t);
extern type_p create_array (type_p t, const char *len);
extern type_p adjust_field_type (type_p, options_p);
extern void note_variable (const char *s, type_p t, options_p o,
struct fileloc *pos);
extern void note_yacc_type (options_p o, pair_p fields,
pair_p typeinfo, struct fileloc *pos);
/* Lexer and parser routines, most automatically generated. */
extern int yylex PARAMS((void));
extern void yyerror PARAMS ((const char *));
extern int yyparse PARAMS ((void));
extern void parse_file PARAMS ((const char *name));
extern int yylex (void);
extern void yyerror (const char *);
extern int yyparse (void);
extern void parse_file (const char *name);
/* Output file handling. */
@ -164,8 +164,8 @@ extern outf_p header_file;
made in INPUT_FILE and is linked into every language that uses
INPUT_FILE. */
extern outf_p get_output_file_with_visibility
PARAMS ((const char *input_file));
const char *get_output_file_name PARAMS ((const char *));
(const char *input_file);
const char *get_output_file_name (const char *);
/* A list of output files suitable for definitions. There is one
BASE_FILES entry for each language. */
@ -174,8 +174,8 @@ extern outf_p base_files[];
/* A bitmap that specifies which of BASE_FILES should be used to
output a definition that is different for each language and must be
defined once in each language that uses INPUT_FILE. */
extern lang_bitmap get_base_file_bitmap PARAMS ((const char *input_file));
extern lang_bitmap get_base_file_bitmap (const char *input_file);
/* Print, like fprintf, to O. */
extern void oprintf PARAMS ((outf_p o, const char *S, ...))
extern void oprintf (outf_p o, const char *S, ...)
ATTRIBUTE_PRINTF_2;

View File

@ -149,11 +149,10 @@ static const char * const optabs[] =
"movstr_optab[$A] = CODE_FOR_$(movstr$a$)",
"clrstr_optab[$A] = CODE_FOR_$(clrstr$a$)" };
static void gen_insn PARAMS ((rtx));
static void gen_insn (rtx);
static void
gen_insn (insn)
rtx insn;
gen_insn (rtx insn)
{
const char *name = XSTR (insn, 0);
int m1 = 0, m2 = 0, op = 0;
@ -321,12 +320,10 @@ gen_insn (insn)
printf (";\n");
}
extern int main PARAMS ((int, char **));
extern int main (int, char **);
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
@ -377,8 +374,7 @@ from the machine description file `md'. */\n\n");
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code ATTRIBUTE_UNUSED;
get_insn_name (int code ATTRIBUTE_UNUSED)
{
return NULL;
}

View File

@ -99,8 +99,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define MAX_MAX_OPERANDS 40
static int n_occurrences PARAMS ((int, const char *));
static const char *strip_whitespace PARAMS ((const char *));
static int n_occurrences (int, const char *);
static const char *strip_whitespace (const char *);
/* insns in the machine description are assigned sequential code numbers
that are used by insn-recog.c (produced by genrecog) to communicate
@ -173,28 +173,27 @@ struct data
static struct data *idata, **idata_end = &idata;
static void output_prologue PARAMS ((void));
static void output_predicate_decls PARAMS ((void));
static void output_operand_data PARAMS ((void));
static void output_insn_data PARAMS ((void));
static void output_get_insn_name PARAMS ((void));
static void scan_operands PARAMS ((struct data *, rtx, int, int));
static int compare_operands PARAMS ((struct operand_data *,
struct operand_data *));
static void place_operands PARAMS ((struct data *));
static void process_template PARAMS ((struct data *, const char *));
static void validate_insn_alternatives PARAMS ((struct data *));
static void validate_insn_operands PARAMS ((struct data *));
static void gen_insn PARAMS ((rtx, int));
static void gen_peephole PARAMS ((rtx, int));
static void gen_expand PARAMS ((rtx, int));
static void gen_split PARAMS ((rtx, int));
static void check_constraint_len PARAMS ((void));
static int constraint_len PARAMS ((const char *, int));
static void output_prologue (void);
static void output_predicate_decls (void);
static void output_operand_data (void);
static void output_insn_data (void);
static void output_get_insn_name (void);
static void scan_operands (struct data *, rtx, int, int);
static int compare_operands (struct operand_data *,
struct operand_data *);
static void place_operands (struct data *);
static void process_template (struct data *, const char *);
static void validate_insn_alternatives (struct data *);
static void validate_insn_operands (struct data *);
static void gen_insn (rtx, int);
static void gen_peephole (rtx, int);
static void gen_expand (rtx, int);
static void gen_split (rtx, int);
static void check_constraint_len (void);
static int constraint_len (const char *, int);
const char *
get_insn_name (index)
int index;
get_insn_name (int index)
{
static char buf[100];
@ -216,7 +215,7 @@ get_insn_name (index)
}
static void
output_prologue ()
output_prologue (void)
{
printf ("/* Generated automatically by the program `genoutput'\n\
from the machine description file `md'. */\n\n");
@ -251,7 +250,7 @@ output_prologue ()
struct predicate { const char *name; struct predicate *next; };
static void
output_predicate_decls ()
output_predicate_decls (void)
{
struct predicate *predicates = 0;
struct operand_data *d;
@ -266,7 +265,7 @@ output_predicate_decls ()
if (p == 0)
{
printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n",
printf ("extern int %s (rtx, enum machine_mode);\n",
d->predicate);
p = (struct predicate *) xmalloc (sizeof (struct predicate));
p->name = d->predicate;
@ -284,7 +283,7 @@ output_predicate_decls ()
}
static void
output_operand_data ()
output_operand_data (void)
{
struct operand_data *d;
@ -311,7 +310,7 @@ output_operand_data ()
}
static void
output_insn_data ()
output_insn_data (void)
{
struct data *d;
int name_offset = 0;
@ -369,7 +368,7 @@ output_insn_data ()
{
const char *p = d->template;
char prev = 0;
printf (" \"");
while (*p)
{
@ -413,7 +412,7 @@ output_insn_data ()
}
static void
output_get_insn_name ()
output_get_insn_name (void)
{
printf ("const char *\n");
printf ("get_insn_name (code)\n");
@ -438,11 +437,8 @@ static int max_opno;
static int num_dups;
static void
scan_operands (d, part, this_address_p, this_strict_low)
struct data *d;
rtx part;
int this_address_p;
int this_strict_low;
scan_operands (struct data *d, rtx part, int this_address_p,
int this_strict_low)
{
int i, j;
const char *format_ptr;
@ -554,7 +550,7 @@ scan_operands (d, part, this_address_p, this_strict_low)
case STRICT_LOW_PART:
scan_operands (d, XEXP (part, 0), 0, 1);
return;
default:
break;
}
@ -579,8 +575,7 @@ scan_operands (d, part, this_address_p, this_strict_low)
/* Compare two operands for content equality. */
static int
compare_operands (d0, d1)
struct operand_data *d0, *d1;
compare_operands (struct operand_data *d0, struct operand_data *d1)
{
const char *p0, *p1;
@ -618,8 +613,7 @@ compare_operands (d0, d1)
find a subsequence that is the same, or allocate a new one at the end. */
static void
place_operands (d)
struct data *d;
place_operands (struct data *d)
{
struct operand_data *od, *od2;
int i;
@ -673,9 +667,7 @@ place_operands (d)
templates, or C code to generate the assembler code template. */
static void
process_template (d, template)
struct data *d;
const char *template;
process_template (struct data *d, const char *template)
{
const char *cp;
int i;
@ -686,7 +678,7 @@ process_template (d, template)
d->template = 0;
d->output_format = INSN_OUTPUT_FORMAT_FUNCTION;
printf ("\nstatic const char *output_%d PARAMS ((rtx *, rtx));\n",
printf ("\nstatic const char *output_%d (rtx *, rtx);\n",
d->code_number);
puts ("\nstatic const char *");
printf ("output_%d (operands, insn)\n", d->code_number);
@ -744,8 +736,7 @@ process_template (d, template)
/* Check insn D for consistency in number of constraint alternatives. */
static void
validate_insn_alternatives (d)
struct data *d;
validate_insn_alternatives (struct data *d)
{
int n = 0, start;
@ -816,8 +807,7 @@ validate_insn_alternatives (d)
/* Verify that there are no gaps in operand numbers for INSNs. */
static void
validate_insn_operands (d)
struct data *d;
validate_insn_operands (struct data *d)
{
int i;
@ -834,9 +824,7 @@ validate_insn_operands (d)
a hairy output action, output a function for now. */
static void
gen_insn (insn, lineno)
rtx insn;
int lineno;
gen_insn (rtx insn, int lineno)
{
struct data *d = (struct data *) xmalloc (sizeof (struct data));
int i;
@ -877,9 +865,7 @@ gen_insn (insn, lineno)
If the insn has a hairy output action, output it now. */
static void
gen_peephole (peep, lineno)
rtx peep;
int lineno;
gen_peephole (rtx peep, int lineno)
{
struct data *d = (struct data *) xmalloc (sizeof (struct data));
int i;
@ -917,9 +903,7 @@ gen_peephole (peep, lineno)
only for the purposes of `insn_gen_function'. */
static void
gen_expand (insn, lineno)
rtx insn;
int lineno;
gen_expand (rtx insn, int lineno)
{
struct data *d = (struct data *) xmalloc (sizeof (struct data));
int i;
@ -962,9 +946,7 @@ gen_expand (insn, lineno)
only for reasons of consistency and to simplify genrecog. */
static void
gen_split (split, lineno)
rtx split;
int lineno;
gen_split (rtx split, int lineno)
{
struct data *d = (struct data *) xmalloc (sizeof (struct data));
int i;
@ -999,12 +981,10 @@ gen_split (split, lineno)
place_operands (d);
}
extern int main PARAMS ((int, char **));
extern int main (int, char **);
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
@ -1037,7 +1017,7 @@ main (argc, argv)
if (GET_CODE (desc) == DEFINE_EXPAND)
gen_expand (desc, line_no);
if (GET_CODE (desc) == DEFINE_SPLIT
|| GET_CODE (desc) == DEFINE_PEEPHOLE2)
|| GET_CODE (desc) == DEFINE_PEEPHOLE2)
gen_split (desc, line_no);
next_index_number++;
}
@ -1057,9 +1037,7 @@ main (argc, argv)
-1 if S is the null string. */
static int
n_occurrences (c, s)
int c;
const char *s;
n_occurrences (int c, const char *s)
{
int n = 0;
@ -1076,8 +1054,7 @@ n_occurrences (c, s)
Return a new string. */
static const char *
strip_whitespace (s)
const char *s;
strip_whitespace (const char *s)
{
char *p, *q;
char ch;
@ -1098,7 +1075,7 @@ strip_whitespace (s)
tampered with. This isn't bullet-proof, but it should catch
most genuine mistakes. */
static void
check_constraint_len ()
check_constraint_len (void)
{
const char *p;
int d;
@ -1110,9 +1087,7 @@ check_constraint_len ()
}
static int
constraint_len (p, genoutput_default_constraint_len)
const char *p;
int genoutput_default_constraint_len;
constraint_len (const char *p, int genoutput_default_constraint_len)
{
/* Check that we still match defaults.h . First we do a generation-time
check that fails if the value is not the expected one... */

View File

@ -1,6 +1,6 @@
/* Generate code from machine description to perform peephole optimizations.
Copyright (C) 1987, 1989, 1992, 1997, 1998,
1999, 2000 Free Software Foundation, Inc.
1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -53,14 +53,13 @@ static int n_operands;
static int insn_code_number = 0;
static void gen_peephole PARAMS ((rtx));
static void match_rtx PARAMS ((rtx, struct link *, int));
static void print_path PARAMS ((struct link *));
static void print_code PARAMS ((RTX_CODE));
static void gen_peephole (rtx);
static void match_rtx (rtx, struct link *, int);
static void print_path (struct link *);
static void print_code (RTX_CODE);
static void
gen_peephole (peep)
rtx peep;
gen_peephole (rtx peep)
{
int ninsns = XVECLEN (peep, 0);
int i;
@ -68,9 +67,6 @@ gen_peephole (peep)
n_operands = 0;
printf (" insn = ins1;\n");
#if 0
printf (" want_jump = 0;\n");
#endif
for (i = 0; i < ninsns; i++)
{
@ -86,14 +82,9 @@ gen_peephole (peep)
printf (" if (GET_CODE (insn) == CODE_LABEL\n\
|| GET_CODE (insn) == BARRIER)\n goto L%d;\n",
insn_code_number);
insn_code_number);
}
#if 0
printf (" if (GET_CODE (insn) == JUMP_INSN)\n");
printf (" want_jump = JUMP_LABEL (insn);\n");
#endif
printf (" pat = PATTERN (insn);\n");
/* Walk the insn's pattern, remembering at all times the path
@ -117,15 +108,6 @@ gen_peephole (peep)
printf (" PATTERN (ins1) = gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (%d, operands));\n", n_operands);
#if 0
printf (" if (want_jump && GET_CODE (ins1) != JUMP_INSN)\n");
printf (" {\n");
printf (" rtx insn2 = emit_jump_insn_before (PATTERN (ins1), ins1);\n");
printf (" delete_related_insns (ins1);\n");
printf (" ins1 = ins2;\n");
printf (" }\n");
#endif
/* Record this define_peephole's insn code in the insn,
as if it had been recognized to match this. */
printf (" INSN_CODE (ins1) = %d;\n",
@ -143,10 +125,7 @@ gen_peephole (peep)
}
static void
match_rtx (x, path, fail_label)
rtx x;
struct link *path;
int fail_label;
match_rtx (rtx x, struct link *path, int fail_label)
{
RTX_CODE code;
int i;
@ -256,7 +235,7 @@ match_rtx (x, path, fail_label)
case ADDRESS:
match_rtx (XEXP (x, 0), path, fail_label);
return;
default:
break;
}
@ -343,8 +322,7 @@ match_rtx (x, path, fail_label)
evaluate to the rtx at that point. */
static void
print_path (path)
struct link *path;
print_path (struct link *path)
{
if (path == 0)
printf ("pat");
@ -363,20 +341,17 @@ print_path (path)
}
static void
print_code (code)
RTX_CODE code;
print_code (RTX_CODE code)
{
const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
putchar (TOUPPER(*p1));
}
extern int main PARAMS ((int, char **));
extern int main (int, char **);
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
@ -457,8 +432,7 @@ from the machine description file `md'. */\n\n");
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code ATTRIBUTE_UNUSED;
get_insn_name (int code ATTRIBUTE_UNUSED)
{
return NULL;
}

View File

@ -2,7 +2,7 @@
- some macros CODE_FOR_... giving the insn_code_number value
for each of the defined standard insn names.
Copyright (C) 1987, 1991, 1995, 1998,
1999, 2000, 2001 Free Software Foundation, Inc.
1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -29,11 +29,9 @@ Boston, MA 02111-1307, USA. */
#define NO_GENRTL_H
#include "rtl.h"
static void output_predicate_decls PARAMS ((void));
extern int main PARAMS ((void));
static void
output_predicate_decls ()
output_predicate_decls (void)
{
#ifdef PREDICATE_CODES
static const struct {
@ -46,14 +44,14 @@ output_predicate_decls ()
puts ("#ifdef RTX_CODE\n");
for (i = 0; i < ARRAY_SIZE (predicate); i++)
printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n",
printf ("extern int %s (rtx, enum machine_mode);\n",
predicate[i].name);
puts ("\n#endif /* RTX_CODE */\n");
#endif
}
int
main ()
main (void)
{
puts ("/* Generated automatically by the program `genpreds'. */\n");
puts ("#ifndef GCC_TM_PREDS_H");

View File

@ -1,6 +1,6 @@
/* Generate code from machine description to recognize rtl as insns.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1997, 1998,
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -229,96 +229,94 @@ static const char *const special_mode_pred_table[] = {
#define NUM_SPECIAL_MODE_PREDS ARRAY_SIZE (special_mode_pred_table)
static struct decision *new_decision
PARAMS ((const char *, struct decision_head *));
(const char *, struct decision_head *);
static struct decision_test *new_decision_test
PARAMS ((enum decision_type, struct decision_test ***));
(enum decision_type, struct decision_test ***);
static rtx find_operand
PARAMS ((rtx, int));
(rtx, int);
static rtx find_matching_operand
PARAMS ((rtx, int));
(rtx, int);
static void validate_pattern
PARAMS ((rtx, rtx, rtx, int));
(rtx, rtx, rtx, int);
static struct decision *add_to_sequence
PARAMS ((rtx, struct decision_head *, const char *, enum routine_type, int));
(rtx, struct decision_head *, const char *, enum routine_type, int);
static int maybe_both_true_2
PARAMS ((struct decision_test *, struct decision_test *));
(struct decision_test *, struct decision_test *);
static int maybe_both_true_1
PARAMS ((struct decision_test *, struct decision_test *));
(struct decision_test *, struct decision_test *);
static int maybe_both_true
PARAMS ((struct decision *, struct decision *, int));
(struct decision *, struct decision *, int);
static int nodes_identical_1
PARAMS ((struct decision_test *, struct decision_test *));
(struct decision_test *, struct decision_test *);
static int nodes_identical
PARAMS ((struct decision *, struct decision *));
(struct decision *, struct decision *);
static void merge_accept_insn
PARAMS ((struct decision *, struct decision *));
(struct decision *, struct decision *);
static void merge_trees
PARAMS ((struct decision_head *, struct decision_head *));
(struct decision_head *, struct decision_head *);
static void factor_tests
PARAMS ((struct decision_head *));
(struct decision_head *);
static void simplify_tests
PARAMS ((struct decision_head *));
(struct decision_head *);
static int break_out_subroutines
PARAMS ((struct decision_head *, int));
(struct decision_head *, int);
static void find_afterward
PARAMS ((struct decision_head *, struct decision *));
(struct decision_head *, struct decision *);
static void change_state
PARAMS ((const char *, const char *, struct decision *, const char *));
(const char *, const char *, struct decision *, const char *);
static void print_code
PARAMS ((enum rtx_code));
(enum rtx_code);
static void write_afterward
PARAMS ((struct decision *, struct decision *, const char *));
(struct decision *, struct decision *, const char *);
static struct decision *write_switch
PARAMS ((struct decision *, int));
(struct decision *, int);
static void write_cond
PARAMS ((struct decision_test *, int, enum routine_type));
(struct decision_test *, int, enum routine_type);
static void write_action
PARAMS ((struct decision *, struct decision_test *, int, int,
struct decision *, enum routine_type));
(struct decision *, struct decision_test *, int, int,
struct decision *, enum routine_type);
static int is_unconditional
PARAMS ((struct decision_test *, enum routine_type));
(struct decision_test *, enum routine_type);
static int write_node
PARAMS ((struct decision *, int, enum routine_type));
(struct decision *, int, enum routine_type);
static void write_tree_1
PARAMS ((struct decision_head *, int, enum routine_type));
(struct decision_head *, int, enum routine_type);
static void write_tree
PARAMS ((struct decision_head *, const char *, enum routine_type, int));
(struct decision_head *, const char *, enum routine_type, int);
static void write_subroutine
PARAMS ((struct decision_head *, enum routine_type));
(struct decision_head *, enum routine_type);
static void write_subroutines
PARAMS ((struct decision_head *, enum routine_type));
(struct decision_head *, enum routine_type);
static void write_header
PARAMS ((void));
(void);
static struct decision_head make_insn_sequence
PARAMS ((rtx, enum routine_type));
(rtx, enum routine_type);
static void process_tree
PARAMS ((struct decision_head *, enum routine_type));
(struct decision_head *, enum routine_type);
static void record_insn_name
PARAMS ((int, const char *));
(int, const char *);
static void debug_decision_0
PARAMS ((struct decision *, int, int));
(struct decision *, int, int);
static void debug_decision_1
PARAMS ((struct decision *, int));
(struct decision *, int);
static void debug_decision_2
PARAMS ((struct decision_test *));
(struct decision_test *);
extern void debug_decision
PARAMS ((struct decision *));
(struct decision *);
extern void debug_decision_list
PARAMS ((struct decision *));
(struct decision *);
/* Create a new node in sequence after LAST. */
static struct decision *
new_decision (position, last)
const char *position;
struct decision_head *last;
new_decision (const char *position, struct decision_head *last)
{
struct decision *new
= (struct decision *) xmalloc (sizeof (struct decision));
@ -335,9 +333,7 @@ new_decision (position, last)
/* Create a new test and link it in at PLACE. */
static struct decision_test *
new_decision_test (type, pplace)
enum decision_type type;
struct decision_test ***pplace;
new_decision_test (enum decision_type type, struct decision_test ***pplace)
{
struct decision_test **place = *pplace;
struct decision_test *test;
@ -356,9 +352,7 @@ new_decision_test (type, pplace)
/* Search for and return operand N. */
static rtx
find_operand (pattern, n)
rtx pattern;
int n;
find_operand (rtx pattern, int n)
{
const char *fmt;
RTX_CODE code;
@ -411,9 +405,7 @@ find_operand (pattern, n)
constraint for operand N. */
static rtx
find_matching_operand (pattern, n)
rtx pattern;
int n;
find_matching_operand (rtx pattern, int n)
{
const char *fmt;
RTX_CODE code;
@ -466,11 +458,7 @@ find_matching_operand (pattern, n)
'+' within a context that requires in-out constraints. */
static void
validate_pattern (pattern, insn, set, set_code)
rtx pattern;
rtx insn;
rtx set;
int set_code;
validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
{
const char *fmt;
RTX_CODE code;
@ -553,7 +541,7 @@ validate_pattern (pattern, insn, set, set_code)
{
const char constraints0 = XSTR (pattern, 2)[0];
/* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we
/* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we
don't use the MATCH_OPERAND constraint, only the predicate.
This is confusing to folks doing new ports, so help them
not make the mistake. */
@ -566,7 +554,7 @@ validate_pattern (pattern, insn, set, set_code)
"warning: constraints not supported in %s",
rtx_name[GET_CODE (insn)]);
}
/* A MATCH_OPERAND that is a SET should have an output reload. */
else if (set && constraints0)
{
@ -590,7 +578,7 @@ validate_pattern (pattern, insn, set, set_code)
else if (constraints0 != '=' && constraints0 != '+')
{
message_with_line (pattern_lineno,
"operand %d missing output reload",
"operand %d missing output reload",
XINT (pattern, 0));
error_count++;
}
@ -767,12 +755,8 @@ validate_pattern (pattern, insn, set, set_code)
A pointer to the final node in the chain is returned. */
static struct decision *
add_to_sequence (pattern, last, position, insn_type, top)
rtx pattern;
struct decision_head *last;
const char *position;
enum routine_type insn_type;
int top;
add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
enum routine_type insn_type, int top)
{
RTX_CODE code;
struct decision *this, *sub;
@ -1062,8 +1046,7 @@ add_to_sequence (pattern, last, position, insn_type, top)
Returns > 0 for "definitely both true" and < 0 for "maybe both true". */
static int
maybe_both_true_2 (d1, d2)
struct decision_test *d1, *d2;
maybe_both_true_2 (struct decision_test *d1, struct decision_test *d2)
{
if (d1->type == d2->type)
{
@ -1173,8 +1156,7 @@ maybe_both_true_2 (d1, d2)
Returns > 0 for "definitely both true" and < 0 for "maybe both true". */
static int
maybe_both_true_1 (d1, d2)
struct decision_test *d1, *d2;
maybe_both_true_1 (struct decision_test *d1, struct decision_test *d2)
{
struct decision_test *t1, *t2;
@ -1208,9 +1190,8 @@ maybe_both_true_1 (d1, d2)
recursively descend. */
static int
maybe_both_true (d1, d2, toplevel)
struct decision *d1, *d2;
int toplevel;
maybe_both_true (struct decision *d1, struct decision *d2,
int toplevel)
{
struct decision *p1, *p2;
int cmp;
@ -1277,8 +1258,7 @@ maybe_both_true (d1, d2, toplevel)
/* A subroutine of nodes_identical. Examine two tests for equivalence. */
static int
nodes_identical_1 (d1, d2)
struct decision_test *d1, *d2;
nodes_identical_1 (struct decision_test *d1, struct decision_test *d2)
{
switch (d1->type)
{
@ -1325,8 +1305,7 @@ nodes_identical_1 (d1, d2)
consider different orderings on the tests. */
static int
nodes_identical (d1, d2)
struct decision *d1, *d2;
nodes_identical (struct decision *d1, struct decision *d2)
{
struct decision_test *t1, *t2;
@ -1362,8 +1341,7 @@ nodes_identical (d1, d2)
source machine description. */
static void
merge_accept_insn (oldd, addd)
struct decision *oldd, *addd;
merge_accept_insn (struct decision *oldd, struct decision *addd)
{
struct decision_test *old, *add;
@ -1407,8 +1385,7 @@ merge_accept_insn (oldd, addd)
/* Merge two decision trees OLDH and ADDH, modifying OLDH destructively. */
static void
merge_trees (oldh, addh)
struct decision_head *oldh, *addh;
merge_trees (struct decision_head *oldh, struct decision_head *addh)
{
struct decision *next, *add;
@ -1492,8 +1469,7 @@ merge_trees (oldh, addh)
(depending on the test type) to emit switch statements later. */
static void
factor_tests (head)
struct decision_head *head;
factor_tests (struct decision_head *head)
{
struct decision *first, *next;
@ -1578,8 +1554,7 @@ factor_tests (head)
predicates, remove them. */
static void
simplify_tests (head)
struct decision_head *head;
simplify_tests (struct decision_head *head)
{
struct decision *tree;
@ -1616,9 +1591,7 @@ simplify_tests (head)
that is generated. */
static int
break_out_subroutines (head, initial)
struct decision_head *head;
int initial;
break_out_subroutines (struct decision_head *head, int initial)
{
int size = 0;
struct decision *sub;
@ -1638,9 +1611,7 @@ break_out_subroutines (head, initial)
when p is true. */
static void
find_afterward (head, real_afterward)
struct decision_head *head;
struct decision *real_afterward;
find_afterward (struct decision_head *head, struct decision *real_afterward)
{
struct decision *p, *q, *afterward;
@ -1687,11 +1658,8 @@ find_afterward (head, real_afterward)
match multiple insns and we try to step past the end of the stream. */
static void
change_state (oldpos, newpos, afterward, indent)
const char *oldpos;
const char *newpos;
struct decision *afterward;
const char *indent;
change_state (const char *oldpos, const char *newpos,
struct decision *afterward, const char *indent)
{
int odepth = strlen (oldpos);
int ndepth = strlen (newpos);
@ -1748,8 +1716,7 @@ change_state (oldpos, newpos, afterward, indent)
the name. */
static void
print_code (code)
enum rtx_code code;
print_code (enum rtx_code code)
{
const char *p;
for (p = GET_RTX_NAME (code); *p; p++)
@ -1759,10 +1726,8 @@ print_code (code)
/* Emit code to cross an afterward link -- change state and branch. */
static void
write_afterward (start, afterward, indent)
struct decision *start;
struct decision *afterward;
const char *indent;
write_afterward (struct decision *start, struct decision *afterward,
const char *indent)
{
if (!afterward || start->subroutine_number > 0)
printf("%sgoto ret0;\n", indent);
@ -1777,9 +1742,7 @@ write_afterward (start, afterward, indent)
nodes at START. Return the first node yet untested. */
static struct decision *
write_switch (start, depth)
struct decision *start;
int depth;
write_switch (struct decision *start, int depth)
{
struct decision *p = start;
enum decision_type type = p->tests->type;
@ -1976,10 +1939,8 @@ write_switch (start, depth)
/* Emit code for one test. */
static void
write_cond (p, depth, subroutine_type)
struct decision_test *p;
int depth;
enum routine_type subroutine_type;
write_cond (struct decision_test *p, int depth,
enum routine_type subroutine_type)
{
switch (p->type)
{
@ -2051,12 +2012,9 @@ write_cond (p, depth, subroutine_type)
perform a state change. For the `accept' tests we must do more work. */
static void
write_action (p, test, depth, uncond, success, subroutine_type)
struct decision *p;
struct decision_test *test;
int depth, uncond;
struct decision *success;
enum routine_type subroutine_type;
write_action (struct decision *p, struct decision_test *test,
int depth, int uncond, struct decision *success,
enum routine_type subroutine_type)
{
const char *indent;
int want_close = 0;
@ -2142,9 +2100,7 @@ write_action (p, test, depth, uncond, success, subroutine_type)
/* ??? is_unconditional is a stupid name for a tri-state function. */
static int
is_unconditional (t, subroutine_type)
struct decision_test *t;
enum routine_type subroutine_type;
is_unconditional (struct decision_test *t, enum routine_type subroutine_type)
{
if (t->type == DT_accept_op)
return 1;
@ -2171,10 +2127,8 @@ is_unconditional (t, subroutine_type)
Return true if there is no fallthru path. */
static int
write_node (p, depth, subroutine_type)
struct decision *p;
int depth;
enum routine_type subroutine_type;
write_node (struct decision *p, int depth,
enum routine_type subroutine_type)
{
struct decision_test *test, *last_test;
int uncond;
@ -2210,10 +2164,8 @@ write_node (p, depth, subroutine_type)
/* Emit code for all of the sibling nodes of HEAD. */
static void
write_tree_1 (head, depth, subroutine_type)
struct decision_head *head;
int depth;
enum routine_type subroutine_type;
write_tree_1 (struct decision_head *head, int depth,
enum routine_type subroutine_type)
{
struct decision *p, *next;
int uncond = 0;
@ -2246,11 +2198,8 @@ write_tree_1 (head, depth, subroutine_type)
position at the node that branched to this node. */
static void
write_tree (head, prevpos, type, initial)
struct decision_head *head;
const char *prevpos;
enum routine_type type;
int initial;
write_tree (struct decision_head *head, const char *prevpos,
enum routine_type type, int initial)
{
struct decision *p = head->first;
@ -2306,9 +2255,7 @@ write_tree (head, prevpos, type, initial)
node TREE. */
static void
write_subroutine (head, type)
struct decision_head *head;
enum routine_type type;
write_subroutine (struct decision_head *head, enum routine_type type)
{
int subfunction = head->first ? head->first->subroutine_number : 0;
const char *s_or_e;
@ -2327,7 +2274,7 @@ write_subroutine (head, type)
switch (type)
{
case RECOG:
printf ("%sint recog%s PARAMS ((rtx, rtx, int *));\n", s_or_e, extension);
printf ("%sint recog%s (rtx, rtx, int *);\n", s_or_e, extension);
printf ("%sint\n\
recog%s (x0, insn, pnum_clobbers)\n\
rtx x0 ATTRIBUTE_UNUSED;\n\
@ -2335,14 +2282,14 @@ recog%s (x0, insn, pnum_clobbers)\n\
int *pnum_clobbers ATTRIBUTE_UNUSED;\n", s_or_e, extension);
break;
case SPLIT:
printf ("%srtx split%s PARAMS ((rtx, rtx));\n", s_or_e, extension);
printf ("%srtx split%s (rtx, rtx);\n", s_or_e, extension);
printf ("%srtx\n\
split%s (x0, insn)\n\
rtx x0 ATTRIBUTE_UNUSED;\n\
rtx insn ATTRIBUTE_UNUSED;\n", s_or_e, extension);
break;
case PEEPHOLE2:
printf ("%srtx peephole2%s PARAMS ((rtx, rtx, int *));\n",
printf ("%srtx peephole2%s (rtx, rtx, int *);\n",
s_or_e, extension);
printf ("%srtx\n\
peephole2%s (x0, insn, _pmatch_len)\n\
@ -2373,9 +2320,7 @@ peephole2%s (x0, insn, _pmatch_len)\n\
subroutines, but did not write them out. Do so now. */
static void
write_subroutines (head, type)
struct decision_head *head;
enum routine_type type;
write_subroutines (struct decision_head *head, enum routine_type type)
{
struct decision *p;
@ -2390,7 +2335,7 @@ write_subroutines (head, type)
/* Begin the output file. */
static void
write_header ()
write_header (void)
{
puts ("\
/* Generated automatically by the program `genrecog' from the target\n\
@ -2452,9 +2397,7 @@ write_header ()
TYPE says what type of routine we are recognizing (RECOG or SPLIT). */
static struct decision_head
make_insn_sequence (insn, type)
rtx insn;
enum routine_type type;
make_insn_sequence (rtx insn, enum routine_type type)
{
rtx x;
const char *c_test = XSTR (insn, type == RECOG ? 2 : 1);
@ -2609,12 +2552,12 @@ make_insn_sequence (insn, type)
case SPLIT:
/* Define the subroutine we will call below and emit in genemit. */
printf ("extern rtx gen_split_%d PARAMS ((rtx *));\n", next_insn_code);
printf ("extern rtx gen_split_%d (rtx *);\n", next_insn_code);
break;
case PEEPHOLE2:
/* Define the subroutine we will call below and emit in genemit. */
printf ("extern rtx gen_peephole2_%d PARAMS ((rtx, rtx *));\n",
printf ("extern rtx gen_peephole2_%d (rtx, rtx *);\n",
next_insn_code);
break;
}
@ -2623,9 +2566,7 @@ make_insn_sequence (insn, type)
}
static void
process_tree (head, subroutine_type)
struct decision_head *head;
enum routine_type subroutine_type;
process_tree (struct decision_head *head, enum routine_type subroutine_type)
{
if (head->first == NULL)
{
@ -2652,12 +2593,10 @@ process_tree (head, subroutine_type)
write_subroutine (head, subroutine_type);
}
extern int main PARAMS ((int, char **));
extern int main (int, char **);
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
rtx desc;
struct decision_head recog_tree, split_tree, peephole2_tree, h;
@ -2721,8 +2660,7 @@ main (argc, argv)
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char *
get_insn_name (code)
int code;
get_insn_name (int code)
{
if (code < insn_name_ptr_size)
return insn_name_ptr[code];
@ -2731,9 +2669,7 @@ get_insn_name (code)
}
static void
record_insn_name (code, name)
int code;
const char *name;
record_insn_name (int code, const char *name)
{
static const char *last_real_name = "insn";
static int last_real_code = 0;
@ -2765,8 +2701,7 @@ record_insn_name (code, name)
}
static void
debug_decision_2 (test)
struct decision_test *test;
debug_decision_2 (struct decision_test *test)
{
switch (test->type)
{
@ -2823,9 +2758,7 @@ debug_decision_2 (test)
}
static void
debug_decision_1 (d, indent)
struct decision *d;
int indent;
debug_decision_1 (struct decision *d, int indent)
{
int i;
struct decision_test *test;
@ -2858,9 +2791,7 @@ debug_decision_1 (d, indent)
}
static void
debug_decision_0 (d, indent, maxdepth)
struct decision *d;
int indent, maxdepth;
debug_decision_0 (struct decision *d, int indent, int maxdepth)
{
struct decision *n;
int i;
@ -2881,15 +2812,13 @@ debug_decision_0 (d, indent, maxdepth)
}
void
debug_decision (d)
struct decision *d;
debug_decision (struct decision *d)
{
debug_decision_0 (d, 0, 1000000);
}
void
debug_decision_list (d)
struct decision *d;
debug_decision_list (struct decision *d)
{
while (d)
{

View File

@ -1,5 +1,6 @@
/* Support routines for the various generation passes.
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.
@ -68,8 +69,8 @@ static struct queue_elem **define_cond_exec_tail = &define_cond_exec_queue;
static struct queue_elem *other_queue;
static struct queue_elem **other_tail = &other_queue;
static void queue_pattern PARAMS ((rtx, struct queue_elem ***,
const char *, int));
static void queue_pattern (rtx, struct queue_elem ***,
const char *, int);
/* Current maximum length of directory names in the search path
for include files. (Altered as we get more of them.) */
@ -87,30 +88,30 @@ struct file_name_list *first_dir_md_include = 0; /* First dir to search */
struct file_name_list *first_bracket_include = 0;
struct file_name_list *last_dir_md_include = 0; /* Last in chain */
static void remove_constraints PARAMS ((rtx));
static void process_rtx PARAMS ((rtx, int));
static void remove_constraints (rtx);
static void process_rtx (rtx, int);
static int is_predicable PARAMS ((struct queue_elem *));
static void identify_predicable_attribute PARAMS ((void));
static int n_alternatives PARAMS ((const char *));
static void collect_insn_data PARAMS ((rtx, int *, int *));
static rtx alter_predicate_for_insn PARAMS ((rtx, int, int, int));
static const char *alter_test_for_insn PARAMS ((struct queue_elem *,
struct queue_elem *));
static char *shift_output_template PARAMS ((char *, const char *, int));
static const char *alter_output_for_insn PARAMS ((struct queue_elem *,
struct queue_elem *,
int, int));
static void process_one_cond_exec PARAMS ((struct queue_elem *));
static void process_define_cond_exec PARAMS ((void));
static void process_include PARAMS ((rtx, int));
static char *save_string PARAMS ((const char *, int));
static int is_predicable (struct queue_elem *);
static void identify_predicable_attribute (void);
static int n_alternatives (const char *);
static void collect_insn_data (rtx, int *, int *);
static rtx alter_predicate_for_insn (rtx, int, int, int);
static const char *alter_test_for_insn (struct queue_elem *,
struct queue_elem *);
static char *shift_output_template (char *, const char *, int);
static const char *alter_output_for_insn (struct queue_elem *,
struct queue_elem *,
int, int);
static void process_one_cond_exec (struct queue_elem *);
static void process_define_cond_exec (void);
static void process_include (rtx, int);
static char *save_string (const char *, int);
void
message_with_line (int lineno, const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno);
@ -124,9 +125,8 @@ message_with_line (int lineno, const char *msg, ...)
the gensupport programs. */
rtx
gen_rtx_CONST_INT (mode, arg)
enum machine_mode mode ATTRIBUTE_UNUSED;
HOST_WIDE_INT arg;
gen_rtx_CONST_INT (enum machine_mode mode ATTRIBUTE_UNUSED,
HOST_WIDE_INT arg)
{
rtx rt = rtx_alloc (CONST_INT);
@ -137,11 +137,8 @@ gen_rtx_CONST_INT (mode, arg)
/* Queue PATTERN on LIST_TAIL. */
static void
queue_pattern (pattern, list_tail, filename, lineno)
rtx pattern;
struct queue_elem ***list_tail;
const char *filename;
int lineno;
queue_pattern (rtx pattern, struct queue_elem ***list_tail,
const char *filename, int lineno)
{
struct queue_elem *e = (struct queue_elem *) xmalloc (sizeof (*e));
e->data = pattern;
@ -155,8 +152,7 @@ queue_pattern (pattern, list_tail, filename, lineno)
/* Recursively remove constraints from an rtx. */
static void
remove_constraints (part)
rtx part;
remove_constraints (rtx part)
{
int i, j;
const char *format_ptr;
@ -186,13 +182,11 @@ remove_constraints (part)
}
}
/* Process an include file assuming that it lives in gcc/config/{target}/
/* Process an include file assuming that it lives in gcc/config/{target}/
if the include looks like (include "file"). */
static void
process_include (desc, lineno)
rtx desc;
int lineno;
process_include (rtx desc, int lineno)
{
const char *filename = XSTR (desc, 0);
const char *old_filename;
@ -212,7 +206,7 @@ process_include (desc, lineno)
pathname = concat (stackp->fname, sep, filename, NULL);
input_file = fopen (pathname, "r");
if (input_file != NULL)
if (input_file != NULL)
goto success;
free (pathname);
}
@ -268,9 +262,7 @@ process_include (desc, lineno)
/* Process a top level rtx in some way, queueing as appropriate. */
static void
process_rtx (desc, lineno)
rtx desc;
int lineno;
process_rtx (rtx desc, int lineno)
{
switch (GET_CODE (desc))
{
@ -338,8 +330,7 @@ process_rtx (desc, lineno)
a DEFINE_INSN. */
static int
is_predicable (elem)
struct queue_elem *elem;
is_predicable (struct queue_elem *elem)
{
rtvec vec = XVEC (elem->data, 4);
const char *value;
@ -427,7 +418,7 @@ is_predicable (elem)
and its default. */
static void
identify_predicable_attribute ()
identify_predicable_attribute (void)
{
struct queue_elem *elem;
char *p_true, *p_false;
@ -494,8 +485,7 @@ identify_predicable_attribute ()
/* Return the number of alternatives in constraint S. */
static int
n_alternatives (s)
const char *s;
n_alternatives (const char *s)
{
int n = 1;
@ -510,9 +500,7 @@ n_alternatives (s)
operands. */
static void
collect_insn_data (pattern, palt, pmax)
rtx pattern;
int *palt, *pmax;
collect_insn_data (rtx pattern, int *palt, int *pmax)
{
const char *fmt;
enum rtx_code code;
@ -568,9 +556,7 @@ collect_insn_data (pattern, palt, pmax)
}
static rtx
alter_predicate_for_insn (pattern, alt, max_op, lineno)
rtx pattern;
int alt, max_op, lineno;
alter_predicate_for_insn (rtx pattern, int alt, int max_op, int lineno)
{
const char *fmt;
enum rtx_code code;
@ -659,8 +645,8 @@ alter_predicate_for_insn (pattern, alt, max_op, lineno)
}
static const char *
alter_test_for_insn (ce_elem, insn_elem)
struct queue_elem *ce_elem, *insn_elem;
alter_test_for_insn (struct queue_elem *ce_elem,
struct queue_elem *insn_elem)
{
const char *ce_test, *insn_test;
@ -679,10 +665,7 @@ alter_test_for_insn (ce_elem, insn_elem)
adjusted string. */
static char *
shift_output_template (new, old, disp)
char *new;
const char *old;
int disp;
shift_output_template (char *new, const char *old, int disp)
{
while (*old)
{
@ -706,9 +689,9 @@ shift_output_template (new, old, disp)
}
static const char *
alter_output_for_insn (ce_elem, insn_elem, alt, max_op)
struct queue_elem *ce_elem, *insn_elem;
int alt, max_op;
alter_output_for_insn (struct queue_elem *ce_elem,
struct queue_elem *insn_elem,
int alt, int max_op)
{
const char *ce_out, *insn_out;
char *new, *p;
@ -768,8 +751,7 @@ alter_output_for_insn (ce_elem, insn_elem, alt, max_op)
/* Replicate insns as appropriate for the given DEFINE_COND_EXEC. */
static void
process_one_cond_exec (ce_elem)
struct queue_elem *ce_elem;
process_one_cond_exec (struct queue_elem *ce_elem)
{
struct queue_elem *insn_elem;
for (insn_elem = define_insn_queue; insn_elem ; insn_elem = insn_elem->next)
@ -845,7 +827,7 @@ process_one_cond_exec (ce_elem)
patterns appropriately. */
static void
process_define_cond_exec ()
process_define_cond_exec (void)
{
struct queue_elem *elem;
@ -858,9 +840,7 @@ process_define_cond_exec ()
}
static char *
save_string (s, len)
const char *s;
int len;
save_string (const char *s, int len)
{
register char *result = xmalloc (len + 1);
@ -873,9 +853,7 @@ save_string (s, len)
/* The entry point for initializing the reader. */
int
init_md_reader_args (argc, argv)
int argc;
char **argv;
init_md_reader_args (int argc, char **argv)
{
int i;
const char *in_fname;
@ -928,8 +906,7 @@ init_md_reader_args (argc, argv)
/* The entry point for initializing the reader. */
int
init_md_reader (filename)
const char *filename;
init_md_reader (const char *filename)
{
FILE *input_file;
int c;
@ -937,7 +914,7 @@ init_md_reader (filename)
char *lastsl;
lastsl = strrchr (filename, '/');
if (lastsl != NULL)
if (lastsl != NULL)
base_dir = save_string (filename, lastsl - filename + 1 );
read_rtx_filename = filename;
@ -987,9 +964,7 @@ init_md_reader (filename)
/* The entry point for reading a single rtx from an md file. */
rtx
read_md_rtx (lineno, seqnr)
int *lineno;
int *seqnr;
read_md_rtx (int *lineno, int *seqnr)
{
struct queue_elem **queue, *elem;
rtx desc;
@ -1052,8 +1027,7 @@ read_md_rtx (lineno, seqnr)
/* Compute a hash function of a c_test structure, which is keyed
by its ->expr field. */
hashval_t
hash_c_test (x)
const PTR x;
hash_c_test (const void *x)
{
const struct c_test *a = (const struct c_test *) x;
const unsigned char *base, *s = (const unsigned char *) a->expr;
@ -1079,9 +1053,7 @@ hash_c_test (x)
/* Compare two c_test expression structures. */
int
cmp_c_test (x, y)
const PTR x;
const PTR y;
cmp_c_test (const void *x, const void *y)
{
const struct c_test *a = (const struct c_test *) x;
const struct c_test *b = (const struct c_test *) y;
@ -1094,8 +1066,7 @@ cmp_c_test (x, y)
at compile time. Returns a tristate: 1 for known true, 0 for
known false, -1 for unknown. */
int
maybe_eval_c_test (expr)
const char *expr;
maybe_eval_c_test (const char *expr)
{
const struct c_test *test;
struct c_test dummy;
@ -1117,8 +1088,7 @@ maybe_eval_c_test (expr)
/* Given a string, return the number of comma-separated elements in it.
Return 0 for the null string. */
int
n_comma_elts (s)
const char *s;
n_comma_elts (const char *s)
{
int n;
@ -1139,8 +1109,7 @@ n_comma_elts (s)
a comma and an element is ignored. */
const char *
scan_comma_elt (pstr)
const char **pstr;
scan_comma_elt (const char **pstr)
{
const char *start;
const char *p = *pstr;

View File

@ -1,5 +1,5 @@
/* Declarations for rtx-reader support for gen* routines.
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -24,11 +24,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
struct obstack;
extern struct obstack *rtl_obstack;
extern int init_md_reader_args PARAMS ((int, char **));
extern int init_md_reader PARAMS ((const char *));
extern rtx read_md_rtx PARAMS ((int *, int *));
extern int init_md_reader_args (int, char **);
extern int init_md_reader (const char *);
extern rtx read_md_rtx (int *, int *);
extern void message_with_line PARAMS ((int, const char *, ...))
extern void message_with_line (int, const char *, ...)
ATTRIBUTE_PRINTF_2;
/* Set this to 0 to disable automatic elision of insn patterns which
@ -46,7 +46,7 @@ extern const int insn_elision_unavailable;
time, return its truth value; else return -1. The test must have
appeared somewhere in the machine description when genconditions
was run. */
extern int maybe_eval_c_test PARAMS ((const char *));
extern int maybe_eval_c_test (const char *);
/* This table should not be accessed directly; use maybe_eval_c_test. */
struct c_test
@ -59,11 +59,11 @@ extern const struct c_test insn_conditions[];
extern const size_t n_insn_conditions;
#ifdef __HASHTAB_H__
extern hashval_t hash_c_test PARAMS ((const PTR));
extern int cmp_c_test PARAMS ((const PTR, const PTR));
extern hashval_t hash_c_test (const void *);
extern int cmp_c_test (const void *, const void *);
#endif
extern int n_comma_elts PARAMS ((const char *));
extern const char *scan_comma_elt PARAMS ((const char **));
extern int n_comma_elts (const char *);
extern const char *scan_comma_elt (const char **);
#endif /* GCC_GENSUPPORT_H */

View File

@ -1,5 +1,5 @@
/* Message translation utilities.
Copyright (C) 2001 Free Software Foundation, Inc.
Copyright (C) 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
terminal, so it has be set to output messages correctly. */
void
gcc_init_libintl ()
gcc_init_libintl (void)
{
#ifdef HAVE_LC_MESSAGES
setlocale (LC_CTYPE, "");
@ -52,8 +52,7 @@ gcc_init_libintl ()
This is for indenting subsequent output. */
size_t
gcc_gettext_width (msgstr)
const char *msgstr;
gcc_gettext_width (const char *msgstr)
{
size_t nwcs = mbstowcs (0, msgstr, 0);
wchar_t *wmsgstr = alloca ((nwcs + 1) * sizeof (wchar_t));
@ -68,8 +67,7 @@ gcc_gettext_width (msgstr)
the length of the string. */
size_t
gcc_gettext_width (msgstr)
const char *msgstr;
gcc_gettext_width (const char *msgstr)
{
return strlen (msgstr);
}

View File

@ -1,5 +1,5 @@
/* intl.h - internationalization
Copyright 1998, 2001 Free Software Foundation, Inc.
Copyright 1998, 2001, 2003 Free Software Foundation, Inc.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -38,8 +38,8 @@
#endif
#ifdef ENABLE_NLS
extern void gcc_init_libintl PARAMS ((void));
extern size_t gcc_gettext_width PARAMS ((const char *));
extern void gcc_init_libintl (void);
extern size_t gcc_gettext_width (const char *);
#else
/* Stubs. */
# undef textdomain

View File

@ -1,6 +1,6 @@
/* List management for the GNU C-Compiler expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999 Free Software Foundation, Inc.
1999, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@ -27,7 +27,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "rtl.h"
#include "ggc.h"
static void free_list PARAMS ((rtx *, rtx *));
static void free_list (rtx *, rtx *);
/* Functions for maintaining cache-able lists of EXPR_LIST and INSN_LISTs. */
@ -43,8 +43,7 @@ static GTY ((deletable (""))) rtx unused_expr_list;
nodes of one type only. This is only called by free_EXPR_LIST_list
and free_INSN_LIST_list. */
static void
free_list (listp, unused_listp)
rtx *listp, *unused_listp;
free_list (rtx *listp, rtx *unused_listp)
{
rtx link, prev_link;
@ -66,8 +65,7 @@ free_list (listp, unused_listp)
node available, we'll use it, otherwise a call to gen_rtx_INSN_LIST
is made. */
rtx
alloc_INSN_LIST (val, next)
rtx val, next;
alloc_INSN_LIST (rtx val, rtx next)
{
rtx r;
@ -89,9 +87,7 @@ alloc_INSN_LIST (val, next)
node available, we'll use it, otherwise a call to gen_rtx_EXPR_LIST
is made. */
rtx
alloc_EXPR_LIST (kind, val, next)
int kind;
rtx val, next;
alloc_EXPR_LIST (int kind, rtx val, rtx next)
{
rtx r;
@ -111,8 +107,7 @@ alloc_EXPR_LIST (kind, val, next)
/* This function will free up an entire list of EXPR_LIST nodes. */
void
free_EXPR_LIST_list (listp)
rtx *listp;
free_EXPR_LIST_list (rtx *listp)
{
if (*listp == 0)
return;
@ -121,8 +116,7 @@ free_EXPR_LIST_list (listp)
/* This function will free up an entire list of INSN_LIST nodes. */
void
free_INSN_LIST_list (listp)
rtx *listp;
free_INSN_LIST_list (rtx *listp)
{
if (*listp == 0)
return;
@ -131,8 +125,7 @@ free_INSN_LIST_list (listp)
/* This function will free up an individual EXPR_LIST node. */
void
free_EXPR_LIST_node (ptr)
rtx ptr;
free_EXPR_LIST_node (rtx ptr)
{
XEXP (ptr, 1) = unused_expr_list;
unused_expr_list = ptr;
@ -140,8 +133,7 @@ free_EXPR_LIST_node (ptr)
/* This function will free up an individual INSN_LIST node. */
void
free_INSN_LIST_node (ptr)
rtx ptr;
free_INSN_LIST_node (rtx ptr)
{
XEXP (ptr, 1) = unused_insn_list;
unused_insn_list = ptr;

View File

@ -1,5 +1,5 @@
/* params.c - Run-time parameters.
Copyright (C) 2001 Free Software Foundation, Inc.
Copyright (C) 2001, 2003 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>.
This file is part of GCC.
@ -40,9 +40,7 @@ static size_t num_compiler_params;
/* Add the N PARAMS to the current list of compiler parameters. */
void
add_params (params, n)
const param_info params[];
size_t n;
add_params (const param_info params[], size_t n)
{
/* Allocate enough space for the new parameters. */
compiler_params =
@ -60,9 +58,7 @@ add_params (params, n)
/* Set the VALUE associated with the parameter given by NAME. */
void
set_param_value (name, value)
const char *name;
int value;
set_param_value (const char *name, int value)
{
size_t i;

View File

@ -1,5 +1,5 @@
/* params.h - Run-time parameters.
Copyright (C) 2001 Free Software Foundation, Inc.
Copyright (C) 2001, 2003 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>.
This file is part of GCC.
@ -59,13 +59,11 @@ extern param_info *compiler_params;
/* Add the N PARAMS to the current list of compiler parameters. */
extern void add_params
PARAMS ((const param_info params[], size_t n));
extern void add_params (const param_info params[], size_t n);
/* Set the VALUE associated with the parameter given by NAME. */
extern void set_param_value
PARAMS ((const char *name, int value));
extern void set_param_value (const char *name, int value);
/* The parameters in use by language-independent code. */

View File

@ -135,7 +135,7 @@ typedef union rtunion_def rtunion;
/* RTL expression ("rtx"). */
struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"),
struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"),
chain_prev ("RTX_PREV (&%h)")))
{
/* The kind of expression this is. */
@ -377,75 +377,75 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1) \
rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2) \
rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3) \
rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4) \
rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5) \
rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) \
__extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6) \
rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) \
__extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
&& GET_CODE(_rtx) != C7) \
rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) \
__extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
&& GET_CODE(_rtx) != C7 && GET_CODE(_rtx) != C8) \
rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
__FUNCTION__); \
_rtx; })
extern void rtl_check_failed_flag PARAMS ((const char *, rtx, const char *,
int, const char *))
int, const char *))
ATTRIBUTE_NORETURN
;
@ -455,7 +455,7 @@ extern void rtl_check_failed_flag PARAMS ((const char *, rtx, const char *,
#define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) (RTX)
#define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) (RTX)
#define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) (RTX)
#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX)
#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX)
#define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) (RTX)
#define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) (RTX)
#define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX)
@ -673,7 +673,7 @@ enum reg_note
REG_CC_SETTER, REG_CC_USER,
/* Points to a CODE_LABEL. Used by non-JUMP_INSNs to say that the
CODE_LABEL contained in the REG_LABEL note is used by the insn.
CODE_LABEL contained in the REG_LABEL note is used by the insn.
This note is an INSN_LIST. */
REG_LABEL,
@ -724,14 +724,14 @@ enum reg_note
/* Indicates that this insn (which is part of the prologue) computes
a value which might not be used later, and if so it's OK to delete
the insn. Normally, deleting any insn in the prologue is an error.
the insn. Normally, deleting any insn in the prologue is an error.
At present the parameter is unused and set to (const_int 0). */
REG_MAYBE_DEAD,
/* Indicates that a call does not return. */
REG_NORETURN,
/* Indicates that an indirect jump is a non-local goto instead of a
/* Indicates that an indirect jump is a non-local goto instead of a
computed goto. */
REG_NON_LOCAL_GOTO,
@ -782,7 +782,7 @@ extern const char * const reg_note_name[];
between ints and pointers if we use a different macro for the block number.)
*/
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE)
@ -795,7 +795,7 @@ extern const char * const reg_note_name[];
#define NOTE_LINE_NUMBER(INSN) XCINT (INSN, 5, NOTE)
/* Nonzero if INSN is a note marking the beginning of a basic block. */
#define NOTE_INSN_BASIC_BLOCK_P(INSN) \
#define NOTE_INSN_BASIC_BLOCK_P(INSN) \
(GET_CODE (INSN) == NOTE \
&& NOTE_LINE_NUMBER (INSN) == NOTE_INSN_BASIC_BLOCK)
@ -867,7 +867,7 @@ enum insn_note
their homes, etc. */
NOTE_INSN_FUNCTION_BEG,
/* These note where exception handling regions begin and end.
/* These note where exception handling regions begin and end.
Uses NOTE_EH_HANDLER to identify the region in question. */
NOTE_INSN_EH_REGION_BEG,
NOTE_INSN_EH_REGION_END,
@ -1015,7 +1015,7 @@ enum label_kind
/* For a CONST_DOUBLE:
For a DImode, there are two integers CONST_DOUBLE_LOW is the
low-order word and ..._HIGH the high-order.
For a float, there is a REAL_VALUE_TYPE structure, and
For a float, there is a REAL_VALUE_TYPE structure, and
CONST_DOUBLE_REAL_VALUE(r) is a pointer to it. */
#define CONST_DOUBLE_LOW(r) XCWINT (r, 0, CONST_DOUBLE)
#define CONST_DOUBLE_HIGH(r) XCWINT (r, 1, CONST_DOUBLE)
@ -1035,15 +1035,15 @@ enum label_kind
/* in rtlanal.c */
extern unsigned int subreg_lsb PARAMS ((rtx));
extern unsigned int subreg_regno_offset PARAMS ((unsigned int,
enum machine_mode,
unsigned int,
extern unsigned int subreg_regno_offset PARAMS ((unsigned int,
enum machine_mode,
unsigned int,
enum machine_mode));
extern bool subreg_offset_representable_p PARAMS ((unsigned int,
enum machine_mode,
unsigned int,
extern bool subreg_offset_representable_p PARAMS ((unsigned int,
enum machine_mode,
unsigned int,
enum machine_mode));
extern unsigned int subreg_regno PARAMS ((rtx));
extern unsigned int subreg_regno PARAMS ((rtx));
/* 1 if RTX is a subreg containing a reg that is already known to be
sign- or zero-extended from the mode of the subreg to the mode of
@ -1735,12 +1735,12 @@ extern rtx find_use_as_address PARAMS ((rtx, rtx, HOST_WIDE_INT));
/* lists.c */
void free_EXPR_LIST_list PARAMS ((rtx *));
void free_INSN_LIST_list PARAMS ((rtx *));
void free_EXPR_LIST_node PARAMS ((rtx));
void free_INSN_LIST_node PARAMS ((rtx));
rtx alloc_INSN_LIST PARAMS ((rtx, rtx));
rtx alloc_EXPR_LIST PARAMS ((int, rtx, rtx));
void free_EXPR_LIST_list (rtx *);
void free_INSN_LIST_list (rtx *);
void free_EXPR_LIST_node (rtx);
void free_INSN_LIST_node (rtx);
rtx alloc_INSN_LIST (rtx, rtx);
rtx alloc_EXPR_LIST (int, rtx, rtx);
/* regclass.c */
@ -1931,7 +1931,7 @@ extern rtx gen_lowpart_SUBREG PARAMS ((enum machine_mode, rtx));
#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
/* Nonzero if REGNUM is a pointer into the stack frame. */
#define REGNO_PTR_FRAME_P(REGNUM) \
#define REGNO_PTR_FRAME_P(REGNUM) \
((REGNUM) == STACK_POINTER_REGNUM \
|| (REGNUM) == FRAME_POINTER_REGNUM \
|| (REGNUM) == HARD_FRAME_POINTER_REGNUM \
@ -2400,6 +2400,6 @@ extern void tracer PARAMS ((void));
/* Create libcall block around the call. */
#define ECF_LIBCALL_BLOCK 4096
extern int flags_from_decl_or_type PARAMS ((tree));
extern int flags_from_decl_or_type PARAMS ((tree));
#endif /* ! GCC_RTL_H */