From 56c0e996b8de532db95bbca19548ffb92e242a0b Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Tue, 7 Apr 1998 23:47:11 +0000 Subject: [PATCH] c-lex.c (is_class_name): Delete declaration. * c-lex.c (is_class_name): Delete declaration. (whitespace_cr): Make static and add prototype. * c-lex.h (make_pointer_declarator, reinit_parse_for_function, yylex, get_directive_line): Turn declarations into prototypes. (position_after_whitespace, check_newline, yyerror,, is_class_name, forget_protocol_qualifiers, remember_protocol_qualifiers): Add prototypes. * genattr.c (extend_range, write_upcase, gen_attr, write_units): Add prototypes. * gencodes.c (gen_insn): Add prototype. * genconfig.c (walk_insn, gen_insn, gen_expand, gen_split, gen_peephole): Add prototypes. * genflags.c (num_operands, gen_proto, gen_nonproto, gen_insn): Add prototypes. * gengenrtl.c (type_from_format, accessor_from_format, special_rtx, special_format, find_formats, gendecl, genmacro, gendef, genlegend, genheader, gencode): Add prototypes. * genopinit.c (gen_insn): Add prototype. * genoutput.c (output_prologue, output_epilogue, scan_operands, process_template, validate_insn_alternatives, gen_insn, gen_peephole, gen_expand, gen_split, n_occurrences): Add prototypes. * genpeep.c (gen_peephole): Add prototype. * loop.c (find_and_verify_loops, mark_loop_jump, prescan_loop, reg_in_basic_block_p, consec_sets_invariant_p, libcall_other_reg, labels_in_range_p, count_loop_regs_set, note_addr_stored, loop_reg_used_before_p, scan_loop, replace_call_address, skip_consec_insns, libcall_benefit, ignore_some_movables, force_movables, combine_movables, rtx_equal_for_loop_p, move_movables, strength_reduce, valid_initial_value_p, find_mem_givs, record_biv, check_final_value, record_giv, update_giv_derive, basic_induction_var, simplify_giv_expr, general_induction_var, consec_sets_giv, check_dbra_loop, express_from, combine_givs_p, combine_givs, product_cheap_p, maybe_eliminate_biv, maybe_eliminate_biv_1, last_use_this_basic_block, record_initial, update_reg_last_use, iteration_info, analyze_loop_iterations, insert_bct, instrument_loop_bct, indirect_jump_in_function_p): Turn declarations into prototypes. From-SVN: r19038 --- gcc/ChangeLog | 40 ++++++++++++++++++++++ gcc/c-lex.c | 5 ++- gcc/c-lex.h | 16 ++++++--- gcc/genattr.c | 6 ++++ gcc/gencodes.c | 2 ++ gcc/genconfig.c | 6 ++++ gcc/genflags.c | 6 ++++ gcc/gengenrtl.c | 12 +++++++ gcc/genopinit.c | 2 ++ gcc/genoutput.c | 12 ++++++- gcc/genpeep.c | 3 +- gcc/loop.c | 90 ++++++++++++++++++++++++------------------------- 12 files changed, 146 insertions(+), 54 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f2d6bf8e685..4e7744c0cfb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,43 @@ +Wed Apr 8 00:44:18 1998 Bernd Schmidt (crux@pool.informatik.rwth-aachen.de> + + * c-lex.c (is_class_name): Delete declaration. + (whitespace_cr): Make static and add prototype. + * c-lex.h (make_pointer_declarator, reinit_parse_for_function, + yylex, get_directive_line): Turn declarations into prototypes. + (position_after_whitespace, check_newline, yyerror,, is_class_name, + forget_protocol_qualifiers, remember_protocol_qualifiers): Add + prototypes. + * genattr.c (extend_range, write_upcase, gen_attr, write_units): Add + prototypes. + * gencodes.c (gen_insn): Add prototype. + * genconfig.c (walk_insn, gen_insn, gen_expand, gen_split, + gen_peephole): Add prototypes. + * genflags.c (num_operands, gen_proto, gen_nonproto, gen_insn): Add + prototypes. + * gengenrtl.c (type_from_format, accessor_from_format, special_rtx, + special_format, find_formats, gendecl, genmacro, gendef, genlegend, + genheader, gencode): Add prototypes. + * genopinit.c (gen_insn): Add prototype. + * genoutput.c (output_prologue, output_epilogue, scan_operands, + process_template, validate_insn_alternatives, gen_insn, gen_peephole, + gen_expand, gen_split, n_occurrences): Add prototypes. + * genpeep.c (gen_peephole): Add prototype. + * loop.c (find_and_verify_loops, mark_loop_jump, prescan_loop, + reg_in_basic_block_p, consec_sets_invariant_p, libcall_other_reg, + labels_in_range_p, count_loop_regs_set, note_addr_stored, + loop_reg_used_before_p, scan_loop, replace_call_address, + skip_consec_insns, libcall_benefit, ignore_some_movables, + force_movables, combine_movables, rtx_equal_for_loop_p, move_movables, + strength_reduce, valid_initial_value_p, find_mem_givs, record_biv, + check_final_value, record_giv, update_giv_derive, basic_induction_var, + simplify_giv_expr, general_induction_var, consec_sets_giv, + check_dbra_loop, express_from, combine_givs_p, combine_givs, + product_cheap_p, maybe_eliminate_biv, maybe_eliminate_biv_1, + last_use_this_basic_block, record_initial, update_reg_last_use, + iteration_info, analyze_loop_iterations, insert_bct, + instrument_loop_bct, indirect_jump_in_function_p): Turn declarations + into prototypes. + Tue Apr 7 21:48:52 1998 Jeffrey A Law (law@cygnus.com) * pa.h (LEGITIMIZE_RELOAD_ADDRESS): Define. diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 99b21c0382f..8e9e10c8fef 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -93,8 +93,6 @@ tree lastiddecl; int doing_objc_thang; -extern tree is_class_name (); - extern int yydebug; /* File used for outputting assembler code. */ @@ -129,6 +127,7 @@ static int nextchar = -1; #ifdef HANDLE_SYSV_PRAGMA static int handle_sysv_pragma PROTO((int)); #endif /* HANDLE_SYSV_PRAGMA */ +static int whitespace_cr PROTO((int)); static int skip_white_space PROTO((int)); static char *extend_token_buffer PROTO((char *)); static int readescape PROTO((int *)); @@ -334,7 +333,7 @@ yyprint (file, yychar, yylval) /* Iff C is a carriage return, warn about it - if appropriate - and return nonzero. */ -int +static int whitespace_cr (c) int c; { diff --git a/gcc/c-lex.h b/gcc/c-lex.h index c1aed084e5f..5515ce4191b 100644 --- a/gcc/c-lex.h +++ b/gcc/c-lex.h @@ -73,8 +73,16 @@ extern tree lastiddecl; extern char *token_buffer; /* Pointer to token buffer. */ -extern tree make_pointer_declarator (); -extern void reinit_parse_for_function (); -extern int yylex (); +extern tree make_pointer_declarator ((tree, tree)); +extern void reinit_parse_for_function ((void)); +extern void position_after_whitespace PROTO((void)); +extern int check_newline PROTO((void)); -extern char *get_directive_line (); +extern int yylex PROTO((void)); +extern void yyerror PROTO((char *)); + +extern char *get_directive_line PROTO((FILE *)); + +extern void forget_protocol_qualifiers PROTO((void)); +extern void remember_protocol_qualifiers PROTO((void)); +extern tree is_class_name PROTO((void)); diff --git a/gcc/genattr.c b/gcc/genattr.c index 525dce0c2bb..fe3457c45ec 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -57,6 +57,12 @@ struct function_unit struct range issue_delay; /* Range of issue delay values. */ }; +static void extend_range PROTO((struct range *, int, int)); +static void write_upcase PROTO((char *)); +static void gen_attr PROTO((rtx)); +static void write_units PROTO((int, struct range *, struct range *, + struct range *, struct range *, + struct range *)); static void extend_range (range, min, max) struct range *range; diff --git a/gcc/gencodes.c b/gcc/gencodes.c index 1ef7b337740..677c3446aea 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -39,6 +39,8 @@ void fancy_abort PROTO((void)); static int insn_code_number; +static void gen_insn PROTO((rtx)); + static void gen_insn (insn) rtx insn; diff --git a/gcc/genconfig.c b/gcc/genconfig.c index 69f9240983f..ffcb5c38b88 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -50,6 +50,12 @@ char *xmalloc PROTO((unsigned)); static void fatal (); void fancy_abort PROTO((void)); +static void walk_insn_part PROTO((rtx, int, int)); +static void gen_insn PROTO((rtx)); +static void gen_expand PROTO((rtx)); +static void gen_split PROTO((rtx)); +static void gen_peephole PROTO((rtx)); + /* RECOG_P will be non-zero if this pattern was seen in a context where it will be used to recognize, rather than just generate an insn. diff --git a/gcc/genflags.c b/gcc/genflags.c index 9a9db0209a5..9a21ef0c265 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -46,6 +46,12 @@ static struct obstack call_obstack, normal_obstack; /* Max size of names encountered. */ static int max_id_len; +static int num_operands PROTO((rtx)); +static void gen_proto PROTO((rtx)); +static void gen_nonproto PROTO((rtx)); +static void gen_insn PROTO((rtx)); + + /* Count the number of match_operand's found. */ static int diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index 55ac3147480..6a4b3a46051 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -48,6 +48,18 @@ struct rtx_definition defs[] = const char *formats[NUM_RTX_CODE]; +static const char *type_from_format PROTO((char)); +static const char *accessor_from_format PROTO((char)); +static int special_format PROTO((const char *)); +static int special_rtx PROTO((int)); +static void find_formats PROTO((void)); +static void gendecl PROTO((FILE *, const char *)); +static void genmacro PROTO((FILE *, int)); +static void gendef PROTO((FILE *, const char *)); +static void genlegend PROTO((FILE *)); +static void genheader PROTO((FILE *)); +static void gencode PROTO((FILE *)); + static const char * type_from_format (c) char c; diff --git a/gcc/genopinit.c b/gcc/genopinit.c index 7944dec03cb..fad369526a6 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -124,6 +124,8 @@ char *optabs[] = /* Allow linking with print-rtl.c. */ char **insn_name_ptr; +static void gen_insn PROTO((rtx)); + static void gen_insn (insn) rtx insn; diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 540685d3db5..85cca69c540 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -169,10 +169,20 @@ int have_constraints; static int have_error; +static void output_prologue PROTO((void)); +static void output_epilogue PROTO((void)); +static void scan_operands PROTO((rtx, int, int)); +static void process_template PROTO((struct data *, char *)); +static void validate_insn_alternatives PROTO((struct data *)); +static void gen_insn PROTO((rtx)); +static void gen_peephole PROTO((rtx)); +static void gen_expand PROTO((rtx)); +static void gen_split PROTO((rtx)); +static int n_occurrences PROTO((int, char *)); + static void output_prologue () { - printf ("/* Generated automatically by the program `genoutput'\n\ from the machine description file `md'. */\n\n"); diff --git a/gcc/genpeep.c b/gcc/genpeep.c index 0150c565b2d..ab21d401fa1 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -44,7 +44,6 @@ struct link }; char *xmalloc PROTO((unsigned)); -static void match_rtx PROTO((rtx, struct link *, int)); static void fatal (); void fancy_abort PROTO((void)); @@ -59,6 +58,8 @@ static int n_operands; static int insn_code_number = 0; +static void gen_peephole PROTO((rtx)); +static void match_rtx PROTO((rtx, struct link *, int)); static void print_path PROTO((struct link *)); static void print_code PROTO((RTX_CODE)); diff --git a/gcc/loop.c b/gcc/loop.c index a3f7a8f59bc..4d2a6627dd8 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -277,67 +277,67 @@ FILE *loop_dump_stream; /* Forward declarations. */ -static void find_and_verify_loops (); -static void mark_loop_jump (); -static void prescan_loop (); -static int reg_in_basic_block_p (); -static int consec_sets_invariant_p (); -static rtx libcall_other_reg (); -static int labels_in_range_p (); -static void count_loop_regs_set (); -static void note_addr_stored (); -static int loop_reg_used_before_p (); -static void scan_loop (); +static void find_and_verify_loops PROTO((rtx)); +static void mark_loop_jump PROTO((rtx, int)); +static void prescan_loop PROTO((rtx, rtx)); +static int reg_in_basic_block_p PROTO((rtx, rtx)); +static int consec_sets_invariant_p PROTO((rtx, int, rtx)); +static rtx libcall_other_reg PROTO((rtx, rtx)); +static int labels_in_range_p PROTO((rtx, int)); +static void count_loop_regs_set PROTO((rtx, rtx, char *, rtx *, int *, int)); +static void note_addr_stored PROTO((rtx)); +static int loop_reg_used_before_p PROTO((rtx, rtx, rtx, rtx, rtx)); +static void scan_loop PROTO((rtx, rtx, int, int)); #if 0 -static void replace_call_address (); +static void replace_call_address PROTO(()); #endif -static rtx skip_consec_insns (); -static int libcall_benefit (); -static void ignore_some_movables (); -static void force_movables (); -static void combine_movables (); -static int rtx_equal_for_loop_p (); -static void move_movables (); -static void strength_reduce (); -static int valid_initial_value_p (); -static void find_mem_givs (); -static void record_biv (); -static void check_final_value (); -static void record_giv (); -static void update_giv_derive (); -static int basic_induction_var (); -static rtx simplify_giv_expr (); -static int general_induction_var (); -static int consec_sets_giv (); -static int check_dbra_loop (); -static rtx express_from (); -static int combine_givs_p (); -static void combine_givs (); -static int product_cheap_p (); -static int maybe_eliminate_biv (); -static int maybe_eliminate_biv_1 (); -static int last_use_this_basic_block (); -static void record_initial (); -static void update_reg_last_use (); +static rtx skip_consec_insns PROTO((rtx, int)); +static int libcall_benefit PROTO((rtx)); +static void ignore_some_movables PROTO((struct movable *)); +static void force_movables PROTO((struct movable *)); +static void combine_movables PROTO((struct movable *, int)); +static int rtx_equal_for_loop_p PROTO((rtx, rtx, struct movable *)); +static void move_movables PROTO((struct movable *, int, int, rtx, rtx, int)); +static void strength_reduce PROTO((rtx, rtx, rtx, int, rtx, rtx, int)); +static int valid_initial_value_p PROTO((rtx, rtx, int, rtx)); +static void find_mem_givs PROTO((rtx, rtx, int, rtx, rtx)); +static void record_biv PROTO((struct induction *, rtx, rtx, rtx, rtx, int, int)); +static void check_final_value PROTO((struct induction *, rtx, rtx)); +static void record_giv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx, int, enum g_types, int, rtx *, rtx, rtx)); +static void update_giv_derive PROTO((rtx)); +static int basic_induction_var PROTO((rtx, enum machine_mode, rtx, rtx, rtx *, rtx *)); +static rtx simplify_giv_expr PROTO((rtx, int *)); +static int general_induction_var PROTO((rtx, rtx *, rtx *, rtx *)); +static int consec_sets_giv PROTO((int, rtx, rtx, rtx, rtx *, rtx *)); +static int check_dbra_loop PROTO((rtx, int, rtx)); +static rtx express_from PROTO((struct induction *, struct induction *)); +static int combine_givs_p PROTO((struct induction *, struct induction *)); +static void combine_givs PROTO((struct iv_class *)); +static int product_cheap_p PROTO((rtx, rtx)); +static int maybe_eliminate_biv PROTO((struct iv_class *, rtx, rtx, int, int, int)); +static int maybe_eliminate_biv_1 PROTO((rtx, rtx, struct iv_class *, int, rtx)); +static int last_use_this_basic_block PROTO((rtx, rtx)); +static void record_initial PROTO((rtx, rtx)); +static void update_reg_last_use PROTO((rtx, rtx)); #ifdef HAIFA /* This is extern from unroll.c */ -void iteration_info (); +extern void iteration_info PROTO((rtx, rtx *, rtx *, rtx, rtx)); /* Two main functions for implementing bct: first - to be called before loop unrolling, and the second - after */ #ifdef HAVE_decrement_and_branch_on_count -static void analyze_loop_iterations (); -static void insert_bct (); +static void analyze_loop_iterations PROTO((rtx, rtx)); +static void insert_bct PROTO((rtx, rtx)); /* Auxiliary function that inserts the bct pattern into the loop */ -static void instrument_loop_bct (); +static void instrument_loop_bct PROTO((rtx, rtx, rtx)); #endif /* HAVE_decrement_and_branch_on_count */ #endif /* HAIFA */ /* Indirect_jump_in_function is computed once per function. */ int indirect_jump_in_function = 0; -static int indirect_jump_in_function_p (); +static int indirect_jump_in_function_p PROTO((rtx)); /* Relative gain of eliminating various kinds of operations. */