Commit 79a490a9 by Andreas Jaeger

predict.h: Convert to ISO C90 prototypes.


	* predict.h: Convert to ISO C90 prototypes.
	* predict.c: Likewise.
	* tree-dump.h: Likewise.
	* tree-dump.c: Likewise.
	* diagnostic.h: Likewise.
	* diagnostic.c: Likewise.
	* combine.c: Likewise.

	* rtl.h: Convert prototypes of combine.c to ISO C90.

From-SVN: r67626
parent b4fac6a0
...@@ -336,86 +336,80 @@ static struct undobuf undobuf; ...@@ -336,86 +336,80 @@ static struct undobuf undobuf;
static int n_occurrences; static int n_occurrences;
static void do_SUBST PARAMS ((rtx *, rtx)); static void do_SUBST (rtx *, rtx);
static void do_SUBST_INT PARAMS ((int *, int)); static void do_SUBST_INT (int *, int);
static void init_reg_last_arrays PARAMS ((void)); static void init_reg_last_arrays (void);
static void setup_incoming_promotions PARAMS ((void)); static void setup_incoming_promotions (void);
static void set_nonzero_bits_and_sign_copies PARAMS ((rtx, rtx, void *)); static void set_nonzero_bits_and_sign_copies (rtx, rtx, void *);
static int cant_combine_insn_p PARAMS ((rtx)); static int cant_combine_insn_p (rtx);
static int can_combine_p PARAMS ((rtx, rtx, rtx, rtx, rtx *, rtx *)); static int can_combine_p (rtx, rtx, rtx, rtx, rtx *, rtx *);
static int sets_function_arg_p PARAMS ((rtx)); static int sets_function_arg_p (rtx);
static int combinable_i3pat PARAMS ((rtx, rtx *, rtx, rtx, int, rtx *)); static int combinable_i3pat (rtx, rtx *, rtx, rtx, int, rtx *);
static int contains_muldiv PARAMS ((rtx)); static int contains_muldiv (rtx);
static rtx try_combine PARAMS ((rtx, rtx, rtx, int *)); static rtx try_combine (rtx, rtx, rtx, int *);
static void undo_all PARAMS ((void)); static void undo_all (void);
static void undo_commit PARAMS ((void)); static void undo_commit (void);
static rtx *find_split_point PARAMS ((rtx *, rtx)); static rtx *find_split_point (rtx *, rtx);
static rtx subst PARAMS ((rtx, rtx, rtx, int, int)); static rtx subst (rtx, rtx, rtx, int, int);
static rtx combine_simplify_rtx PARAMS ((rtx, enum machine_mode, int, int)); static rtx combine_simplify_rtx (rtx, enum machine_mode, int, int);
static rtx simplify_if_then_else PARAMS ((rtx)); static rtx simplify_if_then_else (rtx);
static rtx simplify_set PARAMS ((rtx)); static rtx simplify_set (rtx);
static rtx simplify_logical PARAMS ((rtx, int)); static rtx simplify_logical (rtx, int);
static rtx expand_compound_operation PARAMS ((rtx)); static rtx expand_compound_operation (rtx);
static rtx expand_field_assignment PARAMS ((rtx)); static rtx expand_field_assignment (rtx);
static rtx make_extraction PARAMS ((enum machine_mode, rtx, HOST_WIDE_INT, static rtx make_extraction (enum machine_mode, rtx, HOST_WIDE_INT,
rtx, unsigned HOST_WIDE_INT, int, rtx, unsigned HOST_WIDE_INT, int, int, int);
int, int)); static rtx extract_left_shift (rtx, int);
static rtx extract_left_shift PARAMS ((rtx, int)); static rtx make_compound_operation (rtx, enum rtx_code);
static rtx make_compound_operation PARAMS ((rtx, enum rtx_code)); static int get_pos_from_mask (unsigned HOST_WIDE_INT,
static int get_pos_from_mask PARAMS ((unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT *);
unsigned HOST_WIDE_INT *)); static rtx force_to_mode (rtx, enum machine_mode,
static rtx force_to_mode PARAMS ((rtx, enum machine_mode, unsigned HOST_WIDE_INT, rtx, int);
unsigned HOST_WIDE_INT, rtx, int)); static rtx if_then_else_cond (rtx, rtx *, rtx *);
static rtx if_then_else_cond PARAMS ((rtx, rtx *, rtx *)); static rtx known_cond (rtx, enum rtx_code, rtx, rtx);
static rtx known_cond PARAMS ((rtx, enum rtx_code, rtx, rtx)); static int rtx_equal_for_field_assignment_p (rtx, rtx);
static int rtx_equal_for_field_assignment_p PARAMS ((rtx, rtx)); static rtx make_field_assignment (rtx);
static rtx make_field_assignment PARAMS ((rtx)); static rtx apply_distributive_law (rtx);
static rtx apply_distributive_law PARAMS ((rtx)); static rtx simplify_and_const_int (rtx, enum machine_mode, rtx,
static rtx simplify_and_const_int PARAMS ((rtx, enum machine_mode, rtx, unsigned HOST_WIDE_INT);
unsigned HOST_WIDE_INT)); static unsigned HOST_WIDE_INT cached_nonzero_bits (rtx, enum machine_mode,
static unsigned HOST_WIDE_INT cached_nonzero_bits rtx, enum machine_mode,
PARAMS ((rtx, enum machine_mode, rtx, unsigned HOST_WIDE_INT);
enum machine_mode, static unsigned HOST_WIDE_INT nonzero_bits1 (rtx, enum machine_mode, rtx,
unsigned HOST_WIDE_INT)); enum machine_mode,
static unsigned HOST_WIDE_INT nonzero_bits1 unsigned HOST_WIDE_INT);
PARAMS ((rtx, enum machine_mode, rtx, static unsigned int cached_num_sign_bit_copies (rtx, enum machine_mode, rtx,
enum machine_mode, enum machine_mode,
unsigned HOST_WIDE_INT)); unsigned int);
static unsigned int cached_num_sign_bit_copies static unsigned int num_sign_bit_copies1 (rtx, enum machine_mode, rtx,
PARAMS ((rtx, enum machine_mode, rtx, enum machine_mode, unsigned int);
enum machine_mode, unsigned int)); static int merge_outer_ops (enum rtx_code *, HOST_WIDE_INT *, enum rtx_code,
static unsigned int num_sign_bit_copies1 HOST_WIDE_INT, enum machine_mode, int *);
PARAMS ((rtx, enum machine_mode, rtx, static rtx simplify_shift_const (rtx, enum rtx_code, enum machine_mode, rtx,
enum machine_mode, unsigned int)); int);
static int merge_outer_ops PARAMS ((enum rtx_code *, HOST_WIDE_INT *, static int recog_for_combine (rtx *, rtx, rtx *);
enum rtx_code, HOST_WIDE_INT, static rtx gen_lowpart_for_combine (enum machine_mode, rtx);
enum machine_mode, int *)); static rtx gen_binary (enum rtx_code, enum machine_mode, rtx, rtx);
static rtx simplify_shift_const PARAMS ((rtx, enum rtx_code, enum machine_mode, static enum rtx_code simplify_comparison (enum rtx_code, rtx *, rtx *);
rtx, int)); static void update_table_tick (rtx);
static int recog_for_combine PARAMS ((rtx *, rtx, rtx *)); static void record_value_for_reg (rtx, rtx, rtx);
static rtx gen_lowpart_for_combine PARAMS ((enum machine_mode, rtx)); static void check_promoted_subreg (rtx, rtx);
static rtx gen_binary PARAMS ((enum rtx_code, enum machine_mode, static void record_dead_and_set_regs_1 (rtx, rtx, void *);
rtx, rtx)); static void record_dead_and_set_regs (rtx);
static enum rtx_code simplify_comparison PARAMS ((enum rtx_code, rtx *, rtx *)); static int get_last_value_validate (rtx *, rtx, int, int);
static void update_table_tick PARAMS ((rtx)); static rtx get_last_value (rtx);
static void record_value_for_reg PARAMS ((rtx, rtx, rtx)); static int use_crosses_set_p (rtx, int);
static void check_promoted_subreg PARAMS ((rtx, rtx)); static void reg_dead_at_p_1 (rtx, rtx, void *);
static void record_dead_and_set_regs_1 PARAMS ((rtx, rtx, void *)); static int reg_dead_at_p (rtx, rtx);
static void record_dead_and_set_regs PARAMS ((rtx)); static void move_deaths (rtx, rtx, int, rtx, rtx *);
static int get_last_value_validate PARAMS ((rtx *, rtx, int, int)); static int reg_bitfield_target_p (rtx, rtx);
static rtx get_last_value PARAMS ((rtx)); static void distribute_notes (rtx, rtx, rtx, rtx);
static int use_crosses_set_p PARAMS ((rtx, int)); static void distribute_links (rtx);
static void reg_dead_at_p_1 PARAMS ((rtx, rtx, void *)); static void mark_used_regs_combine (rtx);
static int reg_dead_at_p PARAMS ((rtx, rtx)); static int insn_cuid (rtx);
static void move_deaths PARAMS ((rtx, rtx, int, rtx, rtx *)); static void record_promoted_value (rtx, rtx);
static int reg_bitfield_target_p PARAMS ((rtx, rtx)); static rtx reversed_comparison (rtx, enum machine_mode, rtx, rtx);
static void distribute_notes PARAMS ((rtx, rtx, rtx, rtx)); static enum rtx_code combine_reversed_comparison_code (rtx);
static void distribute_links PARAMS ((rtx));
static void mark_used_regs_combine PARAMS ((rtx));
static int insn_cuid PARAMS ((rtx));
static void record_promoted_value PARAMS ((rtx, rtx));
static rtx reversed_comparison PARAMS ((rtx, enum machine_mode, rtx, rtx));
static enum rtx_code combine_reversed_comparison_code PARAMS ((rtx));
/* Substitute NEWVAL, an rtx expression, into INTO, a place in some /* Substitute NEWVAL, an rtx expression, into INTO, a place in some
insn. The substitution can be undone by undo_all. If INTO is already insn. The substitution can be undone by undo_all. If INTO is already
...@@ -424,8 +418,7 @@ static enum rtx_code combine_reversed_comparison_code PARAMS ((rtx)); ...@@ -424,8 +418,7 @@ static enum rtx_code combine_reversed_comparison_code PARAMS ((rtx));
the undo table. */ the undo table. */
static void static void
do_SUBST (into, newval) do_SUBST (rtx *into, rtx newval)
rtx *into, newval;
{ {
struct undo *buf; struct undo *buf;
rtx oldval = *into; rtx oldval = *into;
...@@ -480,8 +473,7 @@ do_SUBST (into, newval) ...@@ -480,8 +473,7 @@ do_SUBST (into, newval)
not safe. */ not safe. */
static void static void
do_SUBST_INT (into, newval) do_SUBST_INT (int *into, int newval)
int *into, newval;
{ {
struct undo *buf; struct undo *buf;
int oldval = *into; int oldval = *into;
...@@ -510,9 +502,7 @@ do_SUBST_INT (into, newval) ...@@ -510,9 +502,7 @@ do_SUBST_INT (into, newval)
Return nonzero if the combiner has turned an indirect jump Return nonzero if the combiner has turned an indirect jump
instruction into a direct jump. */ instruction into a direct jump. */
int int
combine_instructions (f, nregs) combine_instructions (rtx f, unsigned int nregs)
rtx f;
unsigned int nregs;
{ {
rtx insn, next; rtx insn, next;
#ifdef HAVE_cc0 #ifdef HAVE_cc0
...@@ -794,7 +784,7 @@ combine_instructions (f, nregs) ...@@ -794,7 +784,7 @@ combine_instructions (f, nregs)
/* Wipe the reg_last_xxx arrays in preparation for another pass. */ /* Wipe the reg_last_xxx arrays in preparation for another pass. */
static void static void
init_reg_last_arrays () init_reg_last_arrays (void)
{ {
unsigned int nregs = combine_max_regno; unsigned int nregs = combine_max_regno;
...@@ -812,7 +802,7 @@ init_reg_last_arrays () ...@@ -812,7 +802,7 @@ init_reg_last_arrays ()
/* Set up any promoted values for incoming argument registers. */ /* Set up any promoted values for incoming argument registers. */
static void static void
setup_incoming_promotions () setup_incoming_promotions (void)
{ {
#ifdef PROMOTE_FUNCTION_ARGS #ifdef PROMOTE_FUNCTION_ARGS
unsigned int regno; unsigned int regno;
...@@ -852,10 +842,8 @@ setup_incoming_promotions () ...@@ -852,10 +842,8 @@ setup_incoming_promotions ()
by any set of X. */ by any set of X. */
static void static void
set_nonzero_bits_and_sign_copies (x, set, data) set_nonzero_bits_and_sign_copies (rtx x, rtx set,
rtx x; void *data ATTRIBUTE_UNUSED)
rtx set;
void *data ATTRIBUTE_UNUSED;
{ {
unsigned int num; unsigned int num;
...@@ -937,12 +925,8 @@ set_nonzero_bits_and_sign_copies (x, set, data) ...@@ -937,12 +925,8 @@ set_nonzero_bits_and_sign_copies (x, set, data)
will return 1. */ will return 1. */
static int static int
can_combine_p (insn, i3, pred, succ, pdest, psrc) can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ,
rtx insn; rtx *pdest, rtx *psrc)
rtx i3;
rtx pred ATTRIBUTE_UNUSED;
rtx succ;
rtx *pdest, *psrc;
{ {
int i; int i;
rtx set = 0, src, dest; rtx set = 0, src, dest;
...@@ -1227,8 +1211,7 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc) ...@@ -1227,8 +1211,7 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
argument for a function in a hard register. */ argument for a function in a hard register. */
static int static int
sets_function_arg_p (pat) sets_function_arg_p (rtx pat)
rtx pat;
{ {
int i; int i;
rtx inner_dest; rtx inner_dest;
...@@ -1301,13 +1284,8 @@ sets_function_arg_p (pat) ...@@ -1301,13 +1284,8 @@ sets_function_arg_p (pat)
Return 1 if the combination is valid, zero otherwise. */ Return 1 if the combination is valid, zero otherwise. */
static int static int
combinable_i3pat (i3, loc, i2dest, i1dest, i1_not_in_src, pi3dest_killed) combinable_i3pat (rtx i3, rtx *loc, rtx i2dest, rtx i1dest,
rtx i3; int i1_not_in_src, rtx *pi3dest_killed)
rtx *loc;
rtx i2dest;
rtx i1dest;
int i1_not_in_src;
rtx *pi3dest_killed;
{ {
rtx x = *loc; rtx x = *loc;
...@@ -1387,8 +1365,7 @@ combinable_i3pat (i3, loc, i2dest, i1dest, i1_not_in_src, pi3dest_killed) ...@@ -1387,8 +1365,7 @@ combinable_i3pat (i3, loc, i2dest, i1dest, i1_not_in_src, pi3dest_killed)
and division. We don't count multiplications by powers of two here. */ and division. We don't count multiplications by powers of two here. */
static int static int
contains_muldiv (x) contains_muldiv (rtx x)
rtx x;
{ {
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
...@@ -1419,8 +1396,7 @@ contains_muldiv (x) ...@@ -1419,8 +1396,7 @@ contains_muldiv (x)
can't perform combinations. */ can't perform combinations. */
static int static int
cant_combine_insn_p (insn) cant_combine_insn_p (rtx insn)
rtx insn;
{ {
rtx set; rtx set;
rtx src, dest; rtx src, dest;
...@@ -1476,9 +1452,7 @@ cant_combine_insn_p (insn) ...@@ -1476,9 +1452,7 @@ cant_combine_insn_p (insn)
new direct jump instruction. */ new direct jump instruction. */
static rtx static rtx
try_combine (i3, i2, i1, new_direct_jump_p) try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
rtx i3, i2, i1;
int *new_direct_jump_p;
{ {
/* New patterns for I3 and I2, respectively. */ /* New patterns for I3 and I2, respectively. */
rtx newpat, newi2pat = 0; rtx newpat, newi2pat = 0;
...@@ -2829,7 +2803,7 @@ try_combine (i3, i2, i1, new_direct_jump_p) ...@@ -2829,7 +2803,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
/* Undo all the modifications recorded in undobuf. */ /* Undo all the modifications recorded in undobuf. */
static void static void
undo_all () undo_all (void)
{ {
struct undo *undo, *next; struct undo *undo, *next;
...@@ -2852,7 +2826,7 @@ undo_all () ...@@ -2852,7 +2826,7 @@ undo_all ()
of the undos to the free list. */ of the undos to the free list. */
static void static void
undo_commit () undo_commit (void)
{ {
struct undo *undo, *next; struct undo *undo, *next;
...@@ -2874,9 +2848,7 @@ undo_commit () ...@@ -2874,9 +2848,7 @@ undo_commit ()
two insns. */ two insns. */
static rtx * static rtx *
find_split_point (loc, insn) find_split_point (rtx *loc, rtx insn)
rtx *loc;
rtx insn;
{ {
rtx x = *loc; rtx x = *loc;
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
...@@ -3291,10 +3263,7 @@ find_split_point (loc, insn) ...@@ -3291,10 +3263,7 @@ find_split_point (loc, insn)
by copying if `n_occurrences' is nonzero. */ by copying if `n_occurrences' is nonzero. */
static rtx static rtx
subst (x, from, to, in_dest, unique_copy) subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy)
rtx x, from, to;
int in_dest;
int unique_copy;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode op0_mode = VOIDmode; enum machine_mode op0_mode = VOIDmode;
...@@ -3564,11 +3533,8 @@ subst (x, from, to, in_dest, unique_copy) ...@@ -3564,11 +3533,8 @@ subst (x, from, to, in_dest, unique_copy)
X is returned; IN_DEST is nonzero if we are inside a SET_DEST. */ X is returned; IN_DEST is nonzero if we are inside a SET_DEST. */
static rtx static rtx
combine_simplify_rtx (x, op0_mode, last, in_dest) combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
rtx x; int in_dest)
enum machine_mode op0_mode;
int last;
int in_dest;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
...@@ -3687,7 +3653,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) ...@@ -3687,7 +3653,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
x = gen_binary (cond_code, mode, cond, cop1); x = gen_binary (cond_code, mode, cond, cop1);
else if (true_rtx == const0_rtx && false_rtx == const_true_rtx else if (true_rtx == const0_rtx && false_rtx == const_true_rtx
&& ((reversed = reversed_comparison_code_parts && ((reversed = reversed_comparison_code_parts
(cond_code, cond, cop1, NULL)) (cond_code, cond, cop1, NULL))
!= UNKNOWN)) != UNKNOWN))
x = gen_binary (reversed, mode, cond, cop1); x = gen_binary (reversed, mode, cond, cop1);
...@@ -3704,11 +3670,11 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) ...@@ -3704,11 +3670,11 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
&& INTVAL (false_rtx) == - STORE_FLAG_VALUE && INTVAL (false_rtx) == - STORE_FLAG_VALUE
&& true_rtx == const0_rtx && true_rtx == const0_rtx
&& ((reversed = reversed_comparison_code_parts && ((reversed = reversed_comparison_code_parts
(cond_code, cond, cop1, NULL)) (cond_code, cond, cop1, NULL))
!= UNKNOWN)) != UNKNOWN))
x = simplify_gen_unary (NEG, mode, x = simplify_gen_unary (NEG, mode,
gen_binary (reversed, mode, gen_binary (reversed, mode,
cond, cop1), cond, cop1),
mode); mode);
else else
return gen_rtx_IF_THEN_ELSE (mode, return gen_rtx_IF_THEN_ELSE (mode,
...@@ -4148,10 +4114,10 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) ...@@ -4148,10 +4114,10 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
&& flag_unsafe_math_optimizations) && flag_unsafe_math_optimizations)
|| GET_CODE (XEXP (x, 0)) == FLOAT_EXTEND) || GET_CODE (XEXP (x, 0)) == FLOAT_EXTEND)
return simplify_gen_unary (GET_MODE_SIZE (GET_MODE (XEXP (XEXP (x, 0), return simplify_gen_unary (GET_MODE_SIZE (GET_MODE (XEXP (XEXP (x, 0),
0))) 0)))
> GET_MODE_SIZE (mode) > GET_MODE_SIZE (mode)
? FLOAT_TRUNCATE : FLOAT_EXTEND, ? FLOAT_TRUNCATE : FLOAT_EXTEND,
mode, mode,
XEXP (XEXP (x, 0), 0), mode); XEXP (XEXP (x, 0), 0), mode);
/* (float_truncate (float x)) is (float x) */ /* (float_truncate (float x)) is (float x) */
...@@ -4729,8 +4695,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) ...@@ -4729,8 +4695,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
/* Simplify X, an IF_THEN_ELSE expression. Return the new expression. */ /* Simplify X, an IF_THEN_ELSE expression. Return the new expression. */
static rtx static rtx
simplify_if_then_else (x) simplify_if_then_else (rtx x)
rtx x;
{ {
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
rtx cond = XEXP (x, 0); rtx cond = XEXP (x, 0);
...@@ -5063,8 +5028,7 @@ simplify_if_then_else (x) ...@@ -5063,8 +5028,7 @@ simplify_if_then_else (x)
/* Simplify X, a SET expression. Return the new expression. */ /* Simplify X, a SET expression. Return the new expression. */
static rtx static rtx
simplify_set (x) simplify_set (rtx x)
rtx x;
{ {
rtx src = SET_SRC (x); rtx src = SET_SRC (x);
rtx dest = SET_DEST (x); rtx dest = SET_DEST (x);
...@@ -5398,9 +5362,7 @@ simplify_set (x) ...@@ -5398,9 +5362,7 @@ simplify_set (x)
result. LAST is nonzero if this is the last retry. */ result. LAST is nonzero if this is the last retry. */
static rtx static rtx
simplify_logical (x, last) simplify_logical (rtx x, int last)
rtx x;
int last;
{ {
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
rtx op0 = XEXP (x, 0); rtx op0 = XEXP (x, 0);
...@@ -5710,8 +5672,7 @@ simplify_logical (x, last) ...@@ -5710,8 +5672,7 @@ simplify_logical (x, last)
It is the inverse of this function, loosely speaking. */ It is the inverse of this function, loosely speaking. */
static rtx static rtx
expand_compound_operation (x) expand_compound_operation (rtx x)
rtx x;
{ {
unsigned HOST_WIDE_INT pos = 0, len; unsigned HOST_WIDE_INT pos = 0, len;
int unsignedp = 0; int unsignedp = 0;
...@@ -5919,8 +5880,7 @@ expand_compound_operation (x) ...@@ -5919,8 +5880,7 @@ expand_compound_operation (x)
support variable lengths. */ support variable lengths. */
static rtx static rtx
expand_field_assignment (x) expand_field_assignment (rtx x)
rtx x;
{ {
rtx inner; rtx inner;
rtx pos; /* Always counts from low bit. */ rtx pos; /* Always counts from low bit. */
...@@ -6070,15 +6030,9 @@ expand_field_assignment (x) ...@@ -6070,15 +6030,9 @@ expand_field_assignment (x)
can't handle it. */ can't handle it. */
static rtx static rtx
make_extraction (mode, inner, pos, pos_rtx, len, make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
unsignedp, in_dest, in_compare) rtx pos_rtx, unsigned HOST_WIDE_INT len, int unsignedp,
enum machine_mode mode; int in_dest, int in_compare)
rtx inner;
HOST_WIDE_INT pos;
rtx pos_rtx;
unsigned HOST_WIDE_INT len;
int unsignedp;
int in_dest, in_compare;
{ {
/* This mode describes the size of the storage area /* This mode describes the size of the storage area
to fetch the overall value from. Within that, we to fetch the overall value from. Within that, we
...@@ -6462,9 +6416,7 @@ make_extraction (mode, inner, pos, pos_rtx, len, ...@@ -6462,9 +6416,7 @@ make_extraction (mode, inner, pos, pos_rtx, len,
with any other operations in X. Return X without that shift if so. */ with any other operations in X. Return X without that shift if so. */
static rtx static rtx
extract_left_shift (x, count) extract_left_shift (rtx x, int count)
rtx x;
int count;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
...@@ -6525,9 +6477,7 @@ extract_left_shift (x, count) ...@@ -6525,9 +6477,7 @@ extract_left_shift (x, count)
or a COMPARE against zero, it is COMPARE. */ or a COMPARE against zero, it is COMPARE. */
static rtx static rtx
make_compound_operation (x, in_code) make_compound_operation (rtx x, enum rtx_code in_code)
rtx x;
enum rtx_code in_code;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
...@@ -6795,9 +6745,7 @@ make_compound_operation (x, in_code) ...@@ -6795,9 +6745,7 @@ make_compound_operation (x, in_code)
*PLEN is set to the length of the field. */ *PLEN is set to the length of the field. */
static int static int
get_pos_from_mask (m, plen) get_pos_from_mask (unsigned HOST_WIDE_INT m, unsigned HOST_WIDE_INT *plen)
unsigned HOST_WIDE_INT m;
unsigned HOST_WIDE_INT *plen;
{ {
/* Get the bit number of the first 1 bit from the right, -1 if none. */ /* Get the bit number of the first 1 bit from the right, -1 if none. */
int pos = exact_log2 (m & -m); int pos = exact_log2 (m & -m);
...@@ -6834,12 +6782,8 @@ get_pos_from_mask (m, plen) ...@@ -6834,12 +6782,8 @@ get_pos_from_mask (m, plen)
NOT, NEG, or XOR. */ NOT, NEG, or XOR. */
static rtx static rtx
force_to_mode (x, mode, mask, reg, just_select) force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask,
rtx x; rtx reg, int just_select)
enum machine_mode mode;
unsigned HOST_WIDE_INT mask;
rtx reg;
int just_select;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
int next_select = just_select || code == XOR || code == NOT || code == NEG; int next_select = just_select || code == XOR || code == NOT || code == NEG;
...@@ -7386,9 +7330,7 @@ force_to_mode (x, mode, mask, reg, just_select) ...@@ -7386,9 +7330,7 @@ force_to_mode (x, mode, mask, reg, just_select)
If we return zero, we set *PTRUE and *PFALSE to X. */ If we return zero, we set *PTRUE and *PFALSE to X. */
static rtx static rtx
if_then_else_cond (x, ptrue, pfalse) if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse)
rtx x;
rtx *ptrue, *pfalse;
{ {
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
...@@ -7586,10 +7528,7 @@ if_then_else_cond (x, ptrue, pfalse) ...@@ -7586,10 +7528,7 @@ if_then_else_cond (x, ptrue, pfalse)
arise with IF_THEN_ELSE expressions. */ arise with IF_THEN_ELSE expressions. */
static rtx static rtx
known_cond (x, cond, reg, val) known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val)
rtx x;
enum rtx_code cond;
rtx reg, val;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
rtx temp; rtx temp;
...@@ -7740,9 +7679,7 @@ known_cond (x, cond, reg, val) ...@@ -7740,9 +7679,7 @@ known_cond (x, cond, reg, val)
assignment as a field assignment. */ assignment as a field assignment. */
static int static int
rtx_equal_for_field_assignment_p (x, y) rtx_equal_for_field_assignment_p (rtx x, rtx y)
rtx x;
rtx y;
{ {
if (x == y || rtx_equal_p (x, y)) if (x == y || rtx_equal_p (x, y))
return 1; return 1;
...@@ -7779,8 +7716,7 @@ rtx_equal_for_field_assignment_p (x, y) ...@@ -7779,8 +7716,7 @@ rtx_equal_for_field_assignment_p (x, y)
We only handle the most common cases. */ We only handle the most common cases. */
static rtx static rtx
make_field_assignment (x) make_field_assignment (rtx x)
rtx x;
{ {
rtx dest = SET_DEST (x); rtx dest = SET_DEST (x);
rtx src = SET_SRC (x); rtx src = SET_SRC (x);
...@@ -7907,8 +7843,7 @@ make_field_assignment (x) ...@@ -7907,8 +7843,7 @@ make_field_assignment (x)
if so. */ if so. */
static rtx static rtx
apply_distributive_law (x) apply_distributive_law (rtx x)
rtx x;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
rtx lhs, rhs, other; rtx lhs, rhs, other;
...@@ -8034,11 +7969,8 @@ apply_distributive_law (x) ...@@ -8034,11 +7969,8 @@ apply_distributive_law (x)
X is zero, we are to always construct the equivalent form. */ X is zero, we are to always construct the equivalent form. */
static rtx static rtx
simplify_and_const_int (x, mode, varop, constop) simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop,
rtx x; unsigned HOST_WIDE_INT constop)
enum machine_mode mode;
rtx varop;
unsigned HOST_WIDE_INT constop;
{ {
unsigned HOST_WIDE_INT nonzero; unsigned HOST_WIDE_INT nonzero;
int i; int i;
...@@ -8162,12 +8094,9 @@ simplify_and_const_int (x, mode, varop, constop) ...@@ -8162,12 +8094,9 @@ simplify_and_const_int (x, mode, varop, constop)
identical subexpressions on the first or the second level. */ identical subexpressions on the first or the second level. */
static unsigned HOST_WIDE_INT static unsigned HOST_WIDE_INT
cached_nonzero_bits (x, mode, known_x, known_mode, known_ret) cached_nonzero_bits (rtx x, enum machine_mode mode, rtx known_x,
rtx x; enum machine_mode known_mode,
enum machine_mode mode; unsigned HOST_WIDE_INT known_ret)
rtx known_x;
enum machine_mode known_mode;
unsigned HOST_WIDE_INT known_ret;
{ {
if (x == known_x && mode == known_mode) if (x == known_x && mode == known_mode)
return known_ret; return known_ret;
...@@ -8218,12 +8147,9 @@ cached_nonzero_bits (x, mode, known_x, known_mode, known_ret) ...@@ -8218,12 +8147,9 @@ cached_nonzero_bits (x, mode, known_x, known_mode, known_ret)
a shift, AND, or zero_extract, we can do better. */ a shift, AND, or zero_extract, we can do better. */
static unsigned HOST_WIDE_INT static unsigned HOST_WIDE_INT
nonzero_bits1 (x, mode, known_x, known_mode, known_ret) nonzero_bits1 (rtx x, enum machine_mode mode, rtx known_x,
rtx x; enum machine_mode known_mode,
enum machine_mode mode; unsigned HOST_WIDE_INT known_ret)
rtx known_x;
enum machine_mode known_mode;
unsigned HOST_WIDE_INT known_ret;
{ {
unsigned HOST_WIDE_INT nonzero = GET_MODE_MASK (mode); unsigned HOST_WIDE_INT nonzero = GET_MODE_MASK (mode);
unsigned HOST_WIDE_INT inner_nz; unsigned HOST_WIDE_INT inner_nz;
...@@ -8696,12 +8622,9 @@ nonzero_bits1 (x, mode, known_x, known_mode, known_ret) ...@@ -8696,12 +8622,9 @@ nonzero_bits1 (x, mode, known_x, known_mode, known_ret)
first or the second level. */ first or the second level. */
static unsigned int static unsigned int
cached_num_sign_bit_copies (x, mode, known_x, known_mode, known_ret) cached_num_sign_bit_copies (rtx x, enum machine_mode mode, rtx known_x,
rtx x; enum machine_mode known_mode,
enum machine_mode mode; unsigned int known_ret)
rtx known_x;
enum machine_mode known_mode;
unsigned int known_ret;
{ {
if (x == known_x && mode == known_mode) if (x == known_x && mode == known_mode)
return known_ret; return known_ret;
...@@ -8747,12 +8670,9 @@ cached_num_sign_bit_copies (x, mode, known_x, known_mode, known_ret) ...@@ -8747,12 +8670,9 @@ cached_num_sign_bit_copies (x, mode, known_x, known_mode, known_ret)
be between 1 and the number of bits in MODE. */ be between 1 and the number of bits in MODE. */
static unsigned int static unsigned int
num_sign_bit_copies1 (x, mode, known_x, known_mode, known_ret) num_sign_bit_copies1 (rtx x, enum machine_mode mode, rtx known_x,
rtx x; enum machine_mode known_mode,
enum machine_mode mode; unsigned int known_ret)
rtx known_x;
enum machine_mode known_mode;
unsigned int known_ret;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
unsigned int bitwidth; unsigned int bitwidth;
...@@ -9111,10 +9031,7 @@ num_sign_bit_copies1 (x, mode, known_x, known_mode, known_ret) ...@@ -9111,10 +9031,7 @@ num_sign_bit_copies1 (x, mode, known_x, known_mode, known_ret)
implies that it must be called from a define_split. */ implies that it must be called from a define_split. */
unsigned int unsigned int
extended_count (x, mode, unsignedp) extended_count (rtx x, enum machine_mode mode, int unsignedp)
rtx x;
enum machine_mode mode;
int unsignedp;
{ {
if (nonzero_sign_valid == 0) if (nonzero_sign_valid == 0)
return 0; return 0;
...@@ -9149,13 +9066,7 @@ extended_count (x, mode, unsignedp) ...@@ -9149,13 +9066,7 @@ extended_count (x, mode, unsignedp)
return 0 and do not change *POP0, *PCONST0, and *PCOMP_P. */ return 0 and do not change *POP0, *PCONST0, and *PCOMP_P. */
static int static int
merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p) merge_outer_ops (enum rtx_code *pop0, HOST_WIDE_INT *pconst0, enum rtx_code op1, HOST_WIDE_INT const1, enum machine_mode mode, int *pcomp_p)
enum rtx_code *pop0;
HOST_WIDE_INT *pconst0;
enum rtx_code op1;
HOST_WIDE_INT const1;
enum machine_mode mode;
int *pcomp_p;
{ {
enum rtx_code op0 = *pop0; enum rtx_code op0 = *pop0;
HOST_WIDE_INT const0 = *pconst0; HOST_WIDE_INT const0 = *pconst0;
...@@ -9273,12 +9184,9 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p) ...@@ -9273,12 +9184,9 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p)
are ASHIFTRT and ROTATE, which are always done in their original mode, */ are ASHIFTRT and ROTATE, which are always done in their original mode, */
static rtx static rtx
simplify_shift_const (x, code, result_mode, varop, orig_count) simplify_shift_const (rtx x, enum rtx_code code,
rtx x; enum machine_mode result_mode, rtx varop,
enum rtx_code code; int orig_count)
enum machine_mode result_mode;
rtx varop;
int orig_count;
{ {
enum rtx_code orig_code = code; enum rtx_code orig_code = code;
unsigned int count; unsigned int count;
...@@ -10036,10 +9944,7 @@ simplify_shift_const (x, code, result_mode, varop, orig_count) ...@@ -10036,10 +9944,7 @@ simplify_shift_const (x, code, result_mode, varop, orig_count)
or -1. */ or -1. */
static int static int
recog_for_combine (pnewpat, insn, pnotes) recog_for_combine (rtx *pnewpat, rtx insn, rtx *pnotes)
rtx *pnewpat;
rtx insn;
rtx *pnotes;
{ {
rtx pat = *pnewpat; rtx pat = *pnewpat;
int insn_code_number; int insn_code_number;
...@@ -10144,9 +10049,7 @@ recog_for_combine (pnewpat, insn, pnotes) ...@@ -10144,9 +10049,7 @@ recog_for_combine (pnewpat, insn, pnotes)
#undef gen_lowpart #undef gen_lowpart
static rtx static rtx
gen_lowpart_for_combine (mode, x) gen_lowpart_for_combine (enum machine_mode mode, rtx x)
enum machine_mode mode;
rtx x;
{ {
rtx result; rtx result;
...@@ -10258,10 +10161,7 @@ gen_lowpart_for_combine (mode, x) ...@@ -10258,10 +10161,7 @@ gen_lowpart_for_combine (mode, x)
fold; if not, a new expression is allocated. */ fold; if not, a new expression is allocated. */
static rtx static rtx
gen_binary (code, mode, op0, op1) gen_binary (enum rtx_code code, enum machine_mode mode, rtx op0, rtx op1)
enum rtx_code code;
enum machine_mode mode;
rtx op0, op1;
{ {
rtx result; rtx result;
rtx tem; rtx tem;
...@@ -10320,10 +10220,7 @@ gen_binary (code, mode, op0, op1) ...@@ -10320,10 +10220,7 @@ gen_binary (code, mode, op0, op1)
should have been detected earlier. Hence we ignore all such cases. */ should have been detected earlier. Hence we ignore all such cases. */
static enum rtx_code static enum rtx_code
simplify_comparison (code, pop0, pop1) simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
enum rtx_code code;
rtx *pop0;
rtx *pop1;
{ {
rtx op0 = *pop0; rtx op0 = *pop0;
rtx op1 = *pop1; rtx op1 = *pop1;
...@@ -11470,8 +11367,7 @@ simplify_comparison (code, pop0, pop1) ...@@ -11470,8 +11367,7 @@ simplify_comparison (code, pop0, pop1)
/* Like jump.c' reversed_comparison_code, but use combine infrastructure for /* Like jump.c' reversed_comparison_code, but use combine infrastructure for
searching backward. */ searching backward. */
static enum rtx_code static enum rtx_code
combine_reversed_comparison_code (exp) combine_reversed_comparison_code (rtx exp)
rtx exp;
{ {
enum rtx_code code1 = reversed_comparison_code (exp, NULL); enum rtx_code code1 = reversed_comparison_code (exp, NULL);
rtx x; rtx x;
...@@ -11491,9 +11387,7 @@ combine_reversed_comparison_code (exp) ...@@ -11491,9 +11387,7 @@ combine_reversed_comparison_code (exp)
/* Return comparison with reversed code of EXP and operands OP0 and OP1. /* Return comparison with reversed code of EXP and operands OP0 and OP1.
Return NULL_RTX in case we fail to do the reversal. */ Return NULL_RTX in case we fail to do the reversal. */
static rtx static rtx
reversed_comparison (exp, mode, op0, op1) reversed_comparison (rtx exp, enum machine_mode mode, rtx op0, rtx op1)
rtx exp, op0, op1;
enum machine_mode mode;
{ {
enum rtx_code reversed_code = combine_reversed_comparison_code (exp); enum rtx_code reversed_code = combine_reversed_comparison_code (exp);
if (reversed_code == UNKNOWN) if (reversed_code == UNKNOWN)
...@@ -11507,8 +11401,7 @@ reversed_comparison (exp, mode, op0, op1) ...@@ -11507,8 +11401,7 @@ reversed_comparison (exp, mode, op0, op1)
for each register mentioned. Similar to mention_regs in cse.c */ for each register mentioned. Similar to mention_regs in cse.c */
static void static void
update_table_tick (x) update_table_tick (rtx x)
rtx x;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
const char *fmt = GET_RTX_FORMAT (code); const char *fmt = GET_RTX_FORMAT (code);
...@@ -11579,10 +11472,7 @@ update_table_tick (x) ...@@ -11579,10 +11472,7 @@ update_table_tick (x)
with VALUE also zero and is used to invalidate the register. */ with VALUE also zero and is used to invalidate the register. */
static void static void
record_value_for_reg (reg, insn, value) record_value_for_reg (rtx reg, rtx insn, rtx value)
rtx reg;
rtx insn;
rtx value;
{ {
unsigned int regno = REGNO (reg); unsigned int regno = REGNO (reg);
unsigned int endregno unsigned int endregno
...@@ -11689,9 +11579,7 @@ record_value_for_reg (reg, insn, value) ...@@ -11689,9 +11579,7 @@ record_value_for_reg (reg, insn, value)
set is occurring. */ set is occurring. */
static void static void
record_dead_and_set_regs_1 (dest, setter, data) record_dead_and_set_regs_1 (rtx dest, rtx setter, void *data)
rtx dest, setter;
void *data;
{ {
rtx record_dead_insn = (rtx) data; rtx record_dead_insn = (rtx) data;
...@@ -11733,8 +11621,7 @@ record_dead_and_set_regs_1 (dest, setter, data) ...@@ -11733,8 +11621,7 @@ record_dead_and_set_regs_1 (dest, setter, data)
subroutine call). */ subroutine call). */
static void static void
record_dead_and_set_regs (insn) record_dead_and_set_regs (rtx insn)
rtx insn;
{ {
rtx link; rtx link;
unsigned int i; unsigned int i;
...@@ -11792,9 +11679,7 @@ record_dead_and_set_regs (insn) ...@@ -11792,9 +11679,7 @@ record_dead_and_set_regs (insn)
missed because of that. */ missed because of that. */
static void static void
record_promoted_value (insn, subreg) record_promoted_value (rtx insn, rtx subreg)
rtx insn;
rtx subreg;
{ {
rtx links, set; rtx links, set;
unsigned int regno = REGNO (SUBREG_REG (subreg)); unsigned int regno = REGNO (SUBREG_REG (subreg));
...@@ -11836,9 +11721,7 @@ record_promoted_value (insn, subreg) ...@@ -11836,9 +11721,7 @@ record_promoted_value (insn, subreg)
note what it implies to the registers used in it. */ note what it implies to the registers used in it. */
static void static void
check_promoted_subreg (insn, x) check_promoted_subreg (rtx insn, rtx x)
rtx insn;
rtx x;
{ {
if (GET_CODE (x) == SUBREG && SUBREG_PROMOTED_VAR_P (x) if (GET_CODE (x) == SUBREG && SUBREG_PROMOTED_VAR_P (x)
&& GET_CODE (SUBREG_REG (x)) == REG) && GET_CODE (SUBREG_REG (x)) == REG)
...@@ -11875,11 +11758,7 @@ check_promoted_subreg (insn, x) ...@@ -11875,11 +11758,7 @@ check_promoted_subreg (insn, x)
we don't know exactly what registers it was produced from. */ we don't know exactly what registers it was produced from. */
static int static int
get_last_value_validate (loc, insn, tick, replace) get_last_value_validate (rtx *loc, rtx insn, int tick, int replace)
rtx *loc;
rtx insn;
int tick;
int replace;
{ {
rtx x = *loc; rtx x = *loc;
const char *fmt = GET_RTX_FORMAT (GET_CODE (x)); const char *fmt = GET_RTX_FORMAT (GET_CODE (x));
...@@ -11979,8 +11858,7 @@ get_last_value_validate (loc, insn, tick, replace) ...@@ -11979,8 +11858,7 @@ get_last_value_validate (loc, insn, tick, replace)
is known longer known reliably. */ is known longer known reliably. */
static rtx static rtx
get_last_value (x) get_last_value (rtx x)
rtx x;
{ {
unsigned int regno; unsigned int regno;
rtx value; rtx value;
...@@ -12044,9 +11922,7 @@ get_last_value (x) ...@@ -12044,9 +11922,7 @@ get_last_value (x)
that is set in an instruction more recent than FROM_CUID. */ that is set in an instruction more recent than FROM_CUID. */
static int static int
use_crosses_set_p (x, from_cuid) use_crosses_set_p (rtx x, int from_cuid)
rtx x;
int from_cuid;
{ {
const char *fmt; const char *fmt;
int i; int i;
...@@ -12104,10 +11980,7 @@ static int reg_dead_flag; ...@@ -12104,10 +11980,7 @@ static int reg_dead_flag;
reg_dead_flag to 1 if X is a CLOBBER and to -1 it is a SET. */ reg_dead_flag to 1 if X is a CLOBBER and to -1 it is a SET. */
static void static void
reg_dead_at_p_1 (dest, x, data) reg_dead_at_p_1 (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED)
rtx dest;
rtx x;
void *data ATTRIBUTE_UNUSED;
{ {
unsigned int regno, endregno; unsigned int regno, endregno;
...@@ -12131,9 +12004,7 @@ reg_dead_at_p_1 (dest, x, data) ...@@ -12131,9 +12004,7 @@ reg_dead_at_p_1 (dest, x, data)
must be assumed to be always live. */ must be assumed to be always live. */
static int static int
reg_dead_at_p (reg, insn) reg_dead_at_p (rtx reg, rtx insn)
rtx reg;
rtx insn;
{ {
basic_block block; basic_block block;
unsigned int i; unsigned int i;
...@@ -12192,8 +12063,7 @@ reg_dead_at_p (reg, insn) ...@@ -12192,8 +12063,7 @@ reg_dead_at_p (reg, insn)
that in flow.c, but much simpler since we don't care about pseudos. */ that in flow.c, but much simpler since we don't care about pseudos. */
static void static void
mark_used_regs_combine (x) mark_used_regs_combine (rtx x)
rtx x;
{ {
RTX_CODE code = GET_CODE (x); RTX_CODE code = GET_CODE (x);
unsigned int regno; unsigned int regno;
...@@ -12298,9 +12168,7 @@ mark_used_regs_combine (x) ...@@ -12298,9 +12168,7 @@ mark_used_regs_combine (x)
Return the note used to record the death, if there was one. */ Return the note used to record the death, if there was one. */
rtx rtx
remove_death (regno, insn) remove_death (unsigned int regno, rtx insn)
unsigned int regno;
rtx insn;
{ {
rtx note = find_regno_note (insn, REG_DEAD, regno); rtx note = find_regno_note (insn, REG_DEAD, regno);
...@@ -12324,12 +12192,8 @@ remove_death (regno, insn) ...@@ -12324,12 +12192,8 @@ remove_death (regno, insn)
notes will then be distributed as needed. */ notes will then be distributed as needed. */
static void static void
move_deaths (x, maybe_kill_insn, from_cuid, to_insn, pnotes) move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn,
rtx x; rtx *pnotes)
rtx maybe_kill_insn;
int from_cuid;
rtx to_insn;
rtx *pnotes;
{ {
const char *fmt; const char *fmt;
int len, i; int len, i;
...@@ -12497,9 +12361,7 @@ move_deaths (x, maybe_kill_insn, from_cuid, to_insn, pnotes) ...@@ -12497,9 +12361,7 @@ move_deaths (x, maybe_kill_insn, from_cuid, to_insn, pnotes)
pattern of an insn. X must be a REG. */ pattern of an insn. X must be a REG. */
static int static int
reg_bitfield_target_p (x, body) reg_bitfield_target_p (rtx x, rtx body)
rtx x;
rtx body;
{ {
int i; int i;
...@@ -12548,10 +12410,7 @@ reg_bitfield_target_p (x, body) ...@@ -12548,10 +12410,7 @@ reg_bitfield_target_p (x, body)
on the type of note. */ on the type of note. */
static void static void
distribute_notes (notes, from_insn, i3, i2) distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
rtx notes;
rtx from_insn;
rtx i3, i2;
{ {
rtx note, next_note; rtx note, next_note;
rtx tem; rtx tem;
...@@ -13106,8 +12965,7 @@ distribute_notes (notes, from_insn, i3, i2) ...@@ -13106,8 +12965,7 @@ distribute_notes (notes, from_insn, i3, i2)
add a link pointing at I3 when I3's destination is changed. */ add a link pointing at I3 when I3's destination is changed. */
static void static void
distribute_links (links) distribute_links (rtx links)
rtx links;
{ {
rtx link, next_link; rtx link, next_link;
...@@ -13195,8 +13053,7 @@ distribute_links (links) ...@@ -13195,8 +13053,7 @@ distribute_links (links)
/* Compute INSN_CUID for INSN, which is an insn made by combine. */ /* Compute INSN_CUID for INSN, which is an insn made by combine. */
static int static int
insn_cuid (insn) insn_cuid (rtx insn)
rtx insn;
{ {
while (insn != 0 && INSN_UID (insn) > max_uid_cuid while (insn != 0 && INSN_UID (insn) > max_uid_cuid
&& GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == USE) && GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == USE)
...@@ -13209,8 +13066,7 @@ insn_cuid (insn) ...@@ -13209,8 +13066,7 @@ insn_cuid (insn)
} }
void void
dump_combine_stats (file) dump_combine_stats (FILE *file)
FILE *file;
{ {
fnotice fnotice
(file, (file,
...@@ -13219,8 +13075,7 @@ dump_combine_stats (file) ...@@ -13219,8 +13075,7 @@ dump_combine_stats (file)
} }
void void
dump_combine_total_stats (file) dump_combine_total_stats (FILE *file)
FILE *file;
{ {
fnotice fnotice
(file, (file,
......
...@@ -45,46 +45,44 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -45,46 +45,44 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define prefix_was_emitted_for(BUFFER) (BUFFER)->state.emitted_prefix_p #define prefix_was_emitted_for(BUFFER) (BUFFER)->state.emitted_prefix_p
/* Prototypes. */ /* Prototypes. */
static void output_flush PARAMS ((output_buffer *)); static void output_flush (output_buffer *);
static void output_do_verbatim PARAMS ((output_buffer *, text_info *)); static void output_do_verbatim (output_buffer *, text_info *);
static void output_buffer_to_stream PARAMS ((output_buffer *)); static void output_buffer_to_stream (output_buffer *);
static void output_format PARAMS ((output_buffer *, text_info *)); static void output_format (output_buffer *, text_info *);
static void output_indent PARAMS ((output_buffer *)); static void output_indent (output_buffer *);
static char *build_message_string PARAMS ((const char *, ...)) static char *build_message_string (const char *, ...)
ATTRIBUTE_PRINTF_1; ATTRIBUTE_PRINTF_1;
static void format_with_decl PARAMS ((output_buffer *, text_info *, tree)); static void format_with_decl (output_buffer *, text_info *, tree);
static void diagnostic_for_decl PARAMS ((diagnostic_context *, static void diagnostic_for_decl (diagnostic_context *, diagnostic_info *,
diagnostic_info *, tree)); tree);
static void set_real_maximum_length PARAMS ((output_buffer *)); static void set_real_maximum_length (output_buffer *);
static void output_unsigned_decimal PARAMS ((output_buffer *, unsigned int)); static void output_unsigned_decimal (output_buffer *, unsigned int);
static void output_long_decimal PARAMS ((output_buffer *, long int)); static void output_long_decimal (output_buffer *, long int);
static void output_long_unsigned_decimal PARAMS ((output_buffer *, static void output_long_unsigned_decimal (output_buffer *,
long unsigned int)); long unsigned int);
static void output_octal PARAMS ((output_buffer *, unsigned int)); static void output_octal (output_buffer *, unsigned int);
static void output_long_octal PARAMS ((output_buffer *, unsigned long int)); static void output_long_octal (output_buffer *, unsigned long int);
static void output_hexadecimal PARAMS ((output_buffer *, unsigned int)); static void output_hexadecimal (output_buffer *, unsigned int);
static void output_long_hexadecimal PARAMS ((output_buffer *, static void output_long_hexadecimal (output_buffer *, unsigned long int);
unsigned long int)); static void output_append_r (output_buffer *, const char *, int);
static void output_append_r PARAMS ((output_buffer *, const char *, int)); static void wrap_text (output_buffer *, const char *, const char *);
static void wrap_text PARAMS ((output_buffer *, const char *, const char *)); static void maybe_wrap_text (output_buffer *, const char *, const char *);
static void maybe_wrap_text PARAMS ((output_buffer *, const char *, static void output_clear_data (output_buffer *);
const char *));
static void output_clear_data PARAMS ((output_buffer *)); static void default_diagnostic_starter (diagnostic_context *,
diagnostic_info *);
static void default_diagnostic_starter PARAMS ((diagnostic_context *, static void default_diagnostic_finalizer (diagnostic_context *,
diagnostic_info *)); diagnostic_info *);
static void default_diagnostic_finalizer PARAMS ((diagnostic_context *,
diagnostic_info *)); static void error_recursion (diagnostic_context *) ATTRIBUTE_NORETURN;
static bool text_specifies_location (text_info *, location_t *);
static void error_recursion PARAMS ((diagnostic_context *)) ATTRIBUTE_NORETURN; static bool diagnostic_count_diagnostic (diagnostic_context *,
static bool text_specifies_location PARAMS ((text_info *, location_t *)); diagnostic_info *);
static bool diagnostic_count_diagnostic PARAMS ((diagnostic_context *, static void diagnostic_action_after_output (diagnostic_context *,
diagnostic_info *)); diagnostic_info *);
static void diagnostic_action_after_output PARAMS ((diagnostic_context *, static void real_abort (void) ATTRIBUTE_NORETURN;
diagnostic_info *));
static void real_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
extern int rtl_dump_and_exit; extern int rtl_dump_and_exit;
extern int warnings_are_errors; extern int warnings_are_errors;
...@@ -103,8 +101,7 @@ See %s for instructions.\n" ...@@ -103,8 +101,7 @@ See %s for instructions.\n"
/* Subroutine of output_set_maximum_length. Set up BUFFER's /* Subroutine of output_set_maximum_length. Set up BUFFER's
internal maximum characters per line. */ internal maximum characters per line. */
static void static void
set_real_maximum_length (buffer) set_real_maximum_length (output_buffer *buffer)
output_buffer *buffer;
{ {
/* If we're told not to wrap lines then do the obvious thing. In case /* If we're told not to wrap lines then do the obvious thing. In case
we'll emit prefix only once per diagnostic message, it is appropriate we'll emit prefix only once per diagnostic message, it is appropriate
...@@ -129,9 +126,7 @@ set_real_maximum_length (buffer) ...@@ -129,9 +126,7 @@ set_real_maximum_length (buffer)
/* Sets the number of maximum characters per line BUFFER can output /* Sets the number of maximum characters per line BUFFER can output
in line-wrapping mode. A LENGTH value 0 suppresses line-wrapping. */ in line-wrapping mode. A LENGTH value 0 suppresses line-wrapping. */
void void
output_set_maximum_length (buffer, length) output_set_maximum_length (output_buffer *buffer, int length)
output_buffer *buffer;
int length;
{ {
output_line_cutoff (buffer) = length; output_line_cutoff (buffer) = length;
set_real_maximum_length (buffer); set_real_maximum_length (buffer);
...@@ -139,9 +134,7 @@ output_set_maximum_length (buffer, length) ...@@ -139,9 +134,7 @@ output_set_maximum_length (buffer, length)
/* Sets BUFFER's PREFIX. */ /* Sets BUFFER's PREFIX. */
void void
output_set_prefix (buffer, prefix) output_set_prefix (output_buffer *buffer, const char *prefix)
output_buffer *buffer;
const char *prefix;
{ {
buffer->state.prefix = prefix; buffer->state.prefix = prefix;
set_real_maximum_length (buffer); set_real_maximum_length (buffer);
...@@ -152,8 +145,7 @@ output_set_prefix (buffer, prefix) ...@@ -152,8 +145,7 @@ output_set_prefix (buffer, prefix)
/* Return a pointer to the last character emitted in the output /* Return a pointer to the last character emitted in the output
BUFFER area. A NULL pointer means no character available. */ BUFFER area. A NULL pointer means no character available. */
const char * const char *
output_last_position (buffer) output_last_position (const output_buffer *buffer)
const output_buffer *buffer;
{ {
const char *p = NULL; const char *p = NULL;
...@@ -164,8 +156,7 @@ output_last_position (buffer) ...@@ -164,8 +156,7 @@ output_last_position (buffer)
/* Free BUFFER's prefix, a previously malloc'd string. */ /* Free BUFFER's prefix, a previously malloc'd string. */
void void
output_destroy_prefix (buffer) output_destroy_prefix (output_buffer *buffer)
output_buffer *buffer;
{ {
if (buffer->state.prefix != NULL) if (buffer->state.prefix != NULL)
{ {
...@@ -176,8 +167,7 @@ output_destroy_prefix (buffer) ...@@ -176,8 +167,7 @@ output_destroy_prefix (buffer)
/* Zero out any text output so far in BUFFER. */ /* Zero out any text output so far in BUFFER. */
void void
output_clear_message_text (buffer) output_clear_message_text (output_buffer *buffer)
output_buffer *buffer;
{ {
obstack_free (&buffer->obstack, obstack_base (&buffer->obstack)); obstack_free (&buffer->obstack, obstack_base (&buffer->obstack));
output_text_length (buffer) = 0; output_text_length (buffer) = 0;
...@@ -185,8 +175,7 @@ output_clear_message_text (buffer) ...@@ -185,8 +175,7 @@ output_clear_message_text (buffer)
/* Zero out any formatting data used so far by BUFFER. */ /* Zero out any formatting data used so far by BUFFER. */
static void static void
output_clear_data (buffer) output_clear_data (output_buffer *buffer)
output_buffer *buffer;
{ {
prefix_was_emitted_for (buffer) = false; prefix_was_emitted_for (buffer) = false;
output_indentation (buffer) = 0; output_indentation (buffer) = 0;
...@@ -195,10 +184,8 @@ output_clear_data (buffer) ...@@ -195,10 +184,8 @@ output_clear_data (buffer)
/* Construct an output BUFFER with PREFIX and of MAXIMUM_LENGTH /* Construct an output BUFFER with PREFIX and of MAXIMUM_LENGTH
characters per line. */ characters per line. */
void void
init_output_buffer (buffer, prefix, maximum_length) init_output_buffer (output_buffer *buffer, const char *prefix,
output_buffer *buffer; int maximum_length)
const char *prefix;
int maximum_length;
{ {
memset (buffer, 0, sizeof (output_buffer)); memset (buffer, 0, sizeof (output_buffer));
obstack_init (&buffer->obstack); obstack_init (&buffer->obstack);
...@@ -212,8 +199,7 @@ init_output_buffer (buffer, prefix, maximum_length) ...@@ -212,8 +199,7 @@ init_output_buffer (buffer, prefix, maximum_length)
/* Reinitialize BUFFER. */ /* Reinitialize BUFFER. */
void void
output_clear (buffer) output_clear (output_buffer *buffer)
output_buffer *buffer;
{ {
output_clear_message_text (buffer); output_clear_message_text (buffer);
output_clear_data (buffer); output_clear_data (buffer);
...@@ -222,8 +208,7 @@ output_clear (buffer) ...@@ -222,8 +208,7 @@ output_clear (buffer)
/* Finishes constructing a NULL-terminated character string representing /* Finishes constructing a NULL-terminated character string representing
the BUFFERed message. */ the BUFFERed message. */
const char * const char *
output_finalize_message (buffer) output_finalize_message (output_buffer *buffer)
output_buffer *buffer;
{ {
obstack_1grow (&buffer->obstack, '\0'); obstack_1grow (&buffer->obstack, '\0');
return output_message_text (buffer); return output_message_text (buffer);
...@@ -232,16 +217,14 @@ output_finalize_message (buffer) ...@@ -232,16 +217,14 @@ output_finalize_message (buffer)
/* Return the amount of characters BUFFER can accept to /* Return the amount of characters BUFFER can accept to
make a full line. */ make a full line. */
int int
output_space_left (buffer) output_space_left (const output_buffer *buffer)
const output_buffer *buffer;
{ {
return line_wrap_cutoff (buffer) - output_text_length (buffer); return line_wrap_cutoff (buffer) - output_text_length (buffer);
} }
/* Write out BUFFER's prefix. */ /* Write out BUFFER's prefix. */
void void
output_emit_prefix (buffer) output_emit_prefix (output_buffer *buffer)
output_buffer *buffer;
{ {
if (buffer->state.prefix != NULL) if (buffer->state.prefix != NULL)
{ {
...@@ -273,8 +256,7 @@ output_emit_prefix (buffer) ...@@ -273,8 +256,7 @@ output_emit_prefix (buffer)
/* Have BUFFER start a new line. */ /* Have BUFFER start a new line. */
void void
output_add_newline (buffer) output_add_newline (output_buffer *buffer)
output_buffer *buffer;
{ {
obstack_1grow (&buffer->obstack, '\n'); obstack_1grow (&buffer->obstack, '\n');
output_text_length (buffer) = 0; output_text_length (buffer) = 0;
...@@ -282,9 +264,7 @@ output_add_newline (buffer) ...@@ -282,9 +264,7 @@ output_add_newline (buffer)
/* Appends a character to BUFFER. */ /* Appends a character to BUFFER. */
void void
output_add_character (buffer, c) output_add_character (output_buffer *buffer, int c)
output_buffer *buffer;
int c;
{ {
if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0) if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
output_add_newline (buffer); output_add_newline (buffer);
...@@ -294,8 +274,7 @@ output_add_character (buffer, c) ...@@ -294,8 +274,7 @@ output_add_character (buffer, c)
/* Adds a space to BUFFER. */ /* Adds a space to BUFFER. */
void void
output_add_space (buffer) output_add_space (output_buffer *buffer)
output_buffer *buffer;
{ {
if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0) if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
{ {
...@@ -309,9 +288,7 @@ output_add_space (buffer) ...@@ -309,9 +288,7 @@ output_add_space (buffer)
/* These functions format an INTEGER into BUFFER as suggested by their /* These functions format an INTEGER into BUFFER as suggested by their
names. */ names. */
void void
output_decimal (buffer, i) output_decimal (output_buffer *buffer, int i)
output_buffer *buffer;
int i;
{ {
output_formatted_scalar (buffer, "%d", i); output_formatted_scalar (buffer, "%d", i);
} }
...@@ -367,10 +344,7 @@ output_pointer (output_buffer *buffer, void *p) ...@@ -367,10 +344,7 @@ output_pointer (output_buffer *buffer, void *p)
/* Append to BUFFER a string specified by its STARTING character /* Append to BUFFER a string specified by its STARTING character
and LENGTH. */ and LENGTH. */
static void static void
output_append_r (buffer, start, length) output_append_r (output_buffer *buffer, const char *start, int length)
output_buffer *buffer;
const char *start;
int length;
{ {
obstack_grow (&buffer->obstack, start, length); obstack_grow (&buffer->obstack, start, length);
output_text_length (buffer) += length; output_text_length (buffer) += length;
...@@ -381,10 +355,7 @@ output_append_r (buffer, start, length) ...@@ -381,10 +355,7 @@ output_append_r (buffer, start, length)
and skip any leading whitespace if appropriate. The caller must ensure and skip any leading whitespace if appropriate. The caller must ensure
that it is safe to do so. */ that it is safe to do so. */
void void
output_append (buffer, start, end) output_append (output_buffer *buffer, const char *start, const char *end)
output_buffer *buffer;
const char *start;
const char *end;
{ {
/* Emit prefix and skip whitespace if we're starting a new line. */ /* Emit prefix and skip whitespace if we're starting a new line. */
if (is_starting_newline (buffer)) if (is_starting_newline (buffer))
...@@ -401,8 +372,7 @@ output_append (buffer, start, end) ...@@ -401,8 +372,7 @@ output_append (buffer, start, end)
the current indentation level, assuming that a newline has just the current indentation level, assuming that a newline has just
been written to the buffer. */ been written to the buffer. */
static void static void
output_indent (buffer) output_indent (output_buffer *buffer)
output_buffer *buffer;
{ {
int n = output_indentation (buffer); int n = output_indentation (buffer);
int i; int i;
...@@ -413,10 +383,7 @@ output_indent (buffer) ...@@ -413,10 +383,7 @@ output_indent (buffer)
/* Wrap a text delimited by START and END into BUFFER. */ /* Wrap a text delimited by START and END into BUFFER. */
static void static void
wrap_text (buffer, start, end) wrap_text (output_buffer *buffer, const char *start, const char *end)
output_buffer *buffer;
const char *start;
const char *end;
{ {
bool is_wrapping = output_is_line_wrapping (buffer); bool is_wrapping = output_is_line_wrapping (buffer);
...@@ -448,10 +415,7 @@ wrap_text (buffer, start, end) ...@@ -448,10 +415,7 @@ wrap_text (buffer, start, end)
/* Same as wrap_text but wrap text only when in line-wrapping mode. */ /* Same as wrap_text but wrap text only when in line-wrapping mode. */
static void static void
maybe_wrap_text (buffer, start, end) maybe_wrap_text (output_buffer *buffer, const char *start, const char *end)
output_buffer *buffer;
const char *start;
const char *end;
{ {
if (output_is_line_wrapping (buffer)) if (output_is_line_wrapping (buffer))
wrap_text (buffer, start, end); wrap_text (buffer, start, end);
...@@ -463,18 +427,14 @@ maybe_wrap_text (buffer, start, end) ...@@ -463,18 +427,14 @@ maybe_wrap_text (buffer, start, end)
/* Append a STRING to BUFFER; the STRING might be line-wrapped if in /* Append a STRING to BUFFER; the STRING might be line-wrapped if in
appropriate mode. */ appropriate mode. */
void void
output_add_string (buffer, str) output_add_string (output_buffer *buffer, const char *str)
output_buffer *buffer;
const char *str;
{ {
maybe_wrap_text (buffer, str, str + (str ? strlen (str) : 0)); maybe_wrap_text (buffer, str, str + (str ? strlen (str) : 0));
} }
/* Append an identifier ID to BUFFER. */ /* Append an identifier ID to BUFFER. */
void void
output_add_identifier (buffer, id) output_add_identifier (output_buffer *buffer, tree id)
output_buffer *buffer;
tree id;
{ {
output_append (buffer, IDENTIFIER_POINTER (id), output_append (buffer, IDENTIFIER_POINTER (id),
IDENTIFIER_POINTER (id) + IDENTIFIER_LENGTH (id)); IDENTIFIER_POINTER (id) + IDENTIFIER_LENGTH (id));
...@@ -484,8 +444,7 @@ output_add_identifier (buffer, id) ...@@ -484,8 +444,7 @@ output_add_identifier (buffer, id)
and reinitialize. */ and reinitialize. */
static void static void
output_buffer_to_stream (buffer) output_buffer_to_stream (output_buffer *buffer)
output_buffer *buffer;
{ {
const char *text = output_finalize_message (buffer); const char *text = output_finalize_message (buffer);
fputs (text, output_buffer_attached_stream (buffer)); fputs (text, output_buffer_attached_stream (buffer));
...@@ -507,9 +466,7 @@ output_buffer_to_stream (buffer) ...@@ -507,9 +466,7 @@ output_buffer_to_stream (buffer)
%*.s: a substring the length of which is specified by an integer. %*.s: a substring the length of which is specified by an integer.
%H: location_t. */ %H: location_t. */
static void static void
output_format (buffer, text) output_format (output_buffer *buffer, text_info *text)
output_buffer *buffer;
text_info *text;
{ {
for (; *text->format_spec; ++text->format_spec) for (; *text->format_spec; ++text->format_spec)
{ {
...@@ -650,8 +607,7 @@ build_message_string (const char *msg, ...) ...@@ -650,8 +607,7 @@ build_message_string (const char *msg, ...)
/* Same as diagnostic_build_prefix, but only the source FILE is given. */ /* Same as diagnostic_build_prefix, but only the source FILE is given. */
char * char *
file_name_as_prefix (f) file_name_as_prefix (const char *f)
const char *f;
{ {
return build_message_string ("%s: ", f); return build_message_string ("%s: ", f);
} }
...@@ -673,10 +629,7 @@ output_printf (struct output_buffer *buffer, const char *msgid, ...) ...@@ -673,10 +629,7 @@ output_printf (struct output_buffer *buffer, const char *msgid, ...)
/* Print a message relevant to the given DECL. */ /* Print a message relevant to the given DECL. */
static void static void
format_with_decl (buffer, text, decl) format_with_decl (output_buffer *buffer, text_info *text, tree decl)
output_buffer *buffer;
text_info *text;
tree decl;
{ {
const char *p; const char *p;
...@@ -722,8 +675,7 @@ format_with_decl (buffer, text, decl) ...@@ -722,8 +675,7 @@ format_with_decl (buffer, text, decl)
/* Flush the content of BUFFER onto the attached stream. */ /* Flush the content of BUFFER onto the attached stream. */
static void static void
output_flush (buffer) output_flush (output_buffer *buffer)
output_buffer *buffer;
{ {
output_buffer_to_stream (buffer); output_buffer_to_stream (buffer);
output_clear_data (buffer); output_clear_data (buffer);
...@@ -734,9 +686,7 @@ output_flush (buffer) ...@@ -734,9 +686,7 @@ output_flush (buffer)
/* Helper subroutine of output_verbatim and verbatim. Do the appropriate /* Helper subroutine of output_verbatim and verbatim. Do the appropriate
settings needed by BUFFER for a verbatim formatting. */ settings needed by BUFFER for a verbatim formatting. */
static void static void
output_do_verbatim (buffer, text) output_do_verbatim (output_buffer *buffer, text_info *text)
output_buffer *buffer;
text_info *text;
{ {
diagnostic_prefixing_rule_t rule = output_prefixing_rule (buffer); diagnostic_prefixing_rule_t rule = output_prefixing_rule (buffer);
int line_cutoff = output_line_cutoff (buffer); int line_cutoff = output_line_cutoff (buffer);
...@@ -769,8 +719,7 @@ output_verbatim (output_buffer *buffer, const char *msgid, ...) ...@@ -769,8 +719,7 @@ output_verbatim (output_buffer *buffer, const char *msgid, ...)
/* Initialize the diagnostic message outputting machinery. */ /* Initialize the diagnostic message outputting machinery. */
void void
diagnostic_initialize (context) diagnostic_initialize (diagnostic_context *context)
diagnostic_context *context;
{ {
memset (context, 0, sizeof *context); memset (context, 0, sizeof *context);
obstack_init (&context->buffer.obstack); obstack_init (&context->buffer.obstack);
...@@ -790,9 +739,7 @@ diagnostic_initialize (context) ...@@ -790,9 +739,7 @@ diagnostic_initialize (context)
for a location_t. If so, update the object pointed by LOCUS to reflect for a location_t. If so, update the object pointed by LOCUS to reflect
the specified location in *TEXT->args_ptr. */ the specified location in *TEXT->args_ptr. */
static bool static bool
text_specifies_location (text, locus) text_specifies_location (text_info *text, location_t *locus)
text_info *text;
location_t *locus;
{ {
const char *p; const char *p;
/* Skip any leading text. */ /* Skip any leading text. */
...@@ -811,13 +758,9 @@ text_specifies_location (text, locus) ...@@ -811,13 +758,9 @@ text_specifies_location (text, locus)
} }
void void
diagnostic_set_info (diagnostic, msgid, args, file, line, kind) diagnostic_set_info (diagnostic_info *diagnostic, const char *msgid,
diagnostic_info *diagnostic; va_list *args, const char *file, int line,
const char *msgid; diagnostic_t kind)
va_list *args;
const char *file;
int line;
diagnostic_t kind;
{ {
diagnostic->message.err_no = errno; diagnostic->message.err_no = errno;
diagnostic->message.args_ptr = args; diagnostic->message.args_ptr = args;
...@@ -835,8 +778,7 @@ diagnostic_set_info (diagnostic, msgid, args, file, line, kind) ...@@ -835,8 +778,7 @@ diagnostic_set_info (diagnostic, msgid, args, file, line, kind)
/* Return a malloc'd string describing a location. The caller is /* Return a malloc'd string describing a location. The caller is
responsible for freeing the memory. */ responsible for freeing the memory. */
char * char *
diagnostic_build_prefix (diagnostic) diagnostic_build_prefix (diagnostic_info *diagnostic)
diagnostic_info *diagnostic;
{ {
static const char *const diagnostic_kind_text[] = { static const char *const diagnostic_kind_text[] = {
#define DEFINE_DIAGNOSTIC_KIND(K, T) (T), #define DEFINE_DIAGNOSTIC_KIND(K, T) (T),
...@@ -857,8 +799,7 @@ diagnostic_build_prefix (diagnostic) ...@@ -857,8 +799,7 @@ diagnostic_build_prefix (diagnostic)
} }
void void
diagnostic_flush_buffer (context) diagnostic_flush_buffer (diagnostic_context *context)
diagnostic_context *context;
{ {
output_buffer_to_stream (&context->buffer); output_buffer_to_stream (&context->buffer);
fflush (output_buffer_attached_stream (&context->buffer)); fflush (output_buffer_attached_stream (&context->buffer));
...@@ -866,9 +807,8 @@ diagnostic_flush_buffer (context) ...@@ -866,9 +807,8 @@ diagnostic_flush_buffer (context)
/* Count a diagnostic. Return true if the message should be printed. */ /* Count a diagnostic. Return true if the message should be printed. */
static bool static bool
diagnostic_count_diagnostic (context, diagnostic) diagnostic_count_diagnostic (diagnostic_context *context,
diagnostic_context *context; diagnostic_info *diagnostic)
diagnostic_info *diagnostic;
{ {
diagnostic_t kind = diagnostic->kind; diagnostic_t kind = diagnostic->kind;
switch (kind) switch (kind)
...@@ -930,9 +870,8 @@ diagnostic_count_diagnostic (context, diagnostic) ...@@ -930,9 +870,8 @@ diagnostic_count_diagnostic (context, diagnostic)
/* Take any action which is expected to happen after the diagnostic /* Take any action which is expected to happen after the diagnostic
is written out. This function does not always return. */ is written out. This function does not always return. */
static void static void
diagnostic_action_after_output (context, diagnostic) diagnostic_action_after_output (diagnostic_context *context,
diagnostic_context *context; diagnostic_info *diagnostic)
diagnostic_info *diagnostic;
{ {
switch (diagnostic->kind) switch (diagnostic->kind)
{ {
...@@ -970,8 +909,7 @@ diagnostic_action_after_output (context, diagnostic) ...@@ -970,8 +909,7 @@ diagnostic_action_after_output (context, diagnostic)
/* Called when the start of a function definition is parsed, /* Called when the start of a function definition is parsed,
this function prints on stderr the name of the function. */ this function prints on stderr the name of the function. */
void void
announce_function (decl) announce_function (tree decl)
tree decl;
{ {
if (!quiet_flag) if (!quiet_flag)
{ {
...@@ -988,9 +926,7 @@ announce_function (decl) ...@@ -988,9 +926,7 @@ announce_function (decl)
/* The default function to print out name of current function that caused /* The default function to print out name of current function that caused
an error. */ an error. */
void void
lhd_print_error_function (context, file) lhd_print_error_function (diagnostic_context *context, const char *file)
diagnostic_context *context;
const char *file;
{ {
if (diagnostic_last_function_changed (context)) if (diagnostic_last_function_changed (context))
{ {
...@@ -1026,16 +962,14 @@ lhd_print_error_function (context, file) ...@@ -1026,16 +962,14 @@ lhd_print_error_function (context, file)
We ignore the FILE parameter, as it cannot be relied upon. */ We ignore the FILE parameter, as it cannot be relied upon. */
void void
diagnostic_report_current_function (context) diagnostic_report_current_function (diagnostic_context *context)
diagnostic_context *context;
{ {
diagnostic_report_current_module (context); diagnostic_report_current_module (context);
(*lang_hooks.print_error_function) (context, input_filename); (*lang_hooks.print_error_function) (context, input_filename);
} }
void void
diagnostic_report_current_module (context) diagnostic_report_current_module (diagnostic_context *context)
diagnostic_context *context;
{ {
struct file_stack *p; struct file_stack *p;
...@@ -1063,9 +997,8 @@ diagnostic_report_current_module (context) ...@@ -1063,9 +997,8 @@ diagnostic_report_current_module (context)
} }
static void static void
default_diagnostic_starter (context, diagnostic) default_diagnostic_starter (diagnostic_context *context,
diagnostic_context *context; diagnostic_info *diagnostic)
diagnostic_info *diagnostic;
{ {
diagnostic_report_current_function (context); diagnostic_report_current_function (context);
output_set_prefix (&context->buffer, diagnostic_build_prefix (diagnostic)); output_set_prefix (&context->buffer, diagnostic_build_prefix (diagnostic));
...@@ -1086,9 +1019,8 @@ default_diagnostic_finalizer (context, diagnostic) ...@@ -1086,9 +1019,8 @@ default_diagnostic_finalizer (context, diagnostic)
in the documentation of output_format. */ in the documentation of output_format. */
void void
diagnostic_report_diagnostic (context, diagnostic) diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic_context *context; diagnostic_info *diagnostic)
diagnostic_info *diagnostic;
{ {
if (context->lock++) if (context->lock++)
error_recursion (context); error_recursion (context);
...@@ -1109,10 +1041,8 @@ diagnostic_report_diagnostic (context, diagnostic) ...@@ -1109,10 +1041,8 @@ diagnostic_report_diagnostic (context, diagnostic)
MSG is a format string which uses %s to substitute the declaration MSG is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la output_format. */ name; subsequent substitutions are a la output_format. */
static void static void
diagnostic_for_decl (context, diagnostic, decl) diagnostic_for_decl (diagnostic_context *context,
diagnostic_context *context; diagnostic_info *diagnostic, tree decl)
diagnostic_info *diagnostic;
tree decl;
{ {
if (context->lock++) if (context->lock++)
error_recursion (context); error_recursion (context);
...@@ -1135,8 +1065,7 @@ diagnostic_for_decl (context, diagnostic, decl) ...@@ -1135,8 +1065,7 @@ diagnostic_for_decl (context, diagnostic, decl)
instead of `Internal compiler error in ../../GCC/gcc/expr.c'. */ instead of `Internal compiler error in ../../GCC/gcc/expr.c'. */
const char * const char *
trim_filename (name) trim_filename (const char *name)
const char *name;
{ {
static const char this_file[] = __FILE__; static const char this_file[] = __FILE__;
const char *p = name, *q = this_file; const char *p = name, *q = this_file;
...@@ -1390,8 +1319,7 @@ fnotice (FILE *file, const char *msgid, ...) ...@@ -1390,8 +1319,7 @@ fnotice (FILE *file, const char *msgid, ...)
/* Warn about a use of an identifier which was marked deprecated. */ /* Warn about a use of an identifier which was marked deprecated. */
void void
warn_deprecated_use (node) warn_deprecated_use (tree node)
tree node;
{ {
if (node == 0 || !warn_deprecated_decl) if (node == 0 || !warn_deprecated_decl)
return; return;
...@@ -1433,8 +1361,7 @@ warn_deprecated_use (node) ...@@ -1433,8 +1361,7 @@ warn_deprecated_use (node)
This mustn't use internal_error, that will cause infinite recursion. */ This mustn't use internal_error, that will cause infinite recursion. */
static void static void
error_recursion (context) error_recursion (diagnostic_context *context)
diagnostic_context *context;
{ {
if (context->lock < 3) if (context->lock < 3)
output_flush (&context->buffer); output_flush (&context->buffer);
...@@ -1450,10 +1377,7 @@ error_recursion (context) ...@@ -1450,10 +1377,7 @@ error_recursion (context)
code generally, thanks to a special macro. */ code generally, thanks to a special macro. */
void void
fancy_abort (file, line, function) fancy_abort (const char *file, int line, const char *function)
const char *file;
int line;
const char *function;
{ {
internal_error ("in %s, at %s:%d", function, trim_filename (file), line); internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
} }
...@@ -1462,8 +1386,8 @@ fancy_abort (file, line, function) ...@@ -1462,8 +1386,8 @@ fancy_abort (file, line, function)
this file, so that there are no functions after it that call abort this file, so that there are no functions after it that call abort
and get the system abort instead of our macro. */ and get the system abort instead of our macro. */
#undef abort #undef abort
static void static void
real_abort () real_abort (void)
{ {
abort (); abort ();
} }
...@@ -99,7 +99,7 @@ typedef struct ...@@ -99,7 +99,7 @@ typedef struct
an output_buffer. A client-supplied formatter returns true if everything an output_buffer. A client-supplied formatter returns true if everything
goes well. */ goes well. */
typedef struct output_buffer output_buffer; typedef struct output_buffer output_buffer;
typedef bool (*printer_fn) PARAMS ((output_buffer *, text_info *)); typedef bool (*printer_fn) (output_buffer *, text_info *);
/* The output buffer datatype. This is best seen as an abstract datatype /* The output buffer datatype. This is best seen as an abstract datatype
whose fields should not be accessed directly by clients. */ whose fields should not be accessed directly by clients. */
...@@ -171,8 +171,8 @@ struct output_buffer ...@@ -171,8 +171,8 @@ struct output_buffer
/* Forward declarations. */ /* Forward declarations. */
typedef struct diagnostic_context diagnostic_context; typedef struct diagnostic_context diagnostic_context;
typedef void (*diagnostic_starter_fn) PARAMS ((diagnostic_context *, typedef void (*diagnostic_starter_fn) (diagnostic_context *,
diagnostic_info *)); diagnostic_info *);
typedef diagnostic_starter_fn diagnostic_finalizer_fn; typedef diagnostic_starter_fn diagnostic_finalizer_fn;
/* This data structure bundles altogether any information relevant to /* This data structure bundles altogether any information relevant to
...@@ -207,7 +207,7 @@ struct diagnostic_context ...@@ -207,7 +207,7 @@ struct diagnostic_context
diagnostic_finalizer_fn end_diagnostic; diagnostic_finalizer_fn end_diagnostic;
/* Client hook to report an internal error. */ /* Client hook to report an internal error. */
void (*internal_error) PARAMS ((const char *, va_list *)); void (*internal_error) (const char *, va_list *);
/* Function of last diagnostic message; more generally, function such that /* Function of last diagnostic message; more generally, function such that
if next diagnostic message is in it then we don't have to mention the if next diagnostic message is in it then we don't have to mention the
...@@ -291,45 +291,39 @@ extern diagnostic_context *global_dc; ...@@ -291,45 +291,39 @@ extern diagnostic_context *global_dc;
#define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D) #define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D)
/* Diagnostic related functions. */ /* Diagnostic related functions. */
extern void diagnostic_initialize PARAMS ((diagnostic_context *)); extern void diagnostic_initialize (diagnostic_context *);
extern void diagnostic_report_current_module PARAMS ((diagnostic_context *)); extern void diagnostic_report_current_module (diagnostic_context *);
extern void diagnostic_report_current_function PARAMS ((diagnostic_context *)); extern void diagnostic_report_current_function (diagnostic_context *);
extern void diagnostic_flush_buffer PARAMS ((diagnostic_context *)); extern void diagnostic_flush_buffer (diagnostic_context *);
extern void diagnostic_report_diagnostic PARAMS ((diagnostic_context *, extern void diagnostic_report_diagnostic (diagnostic_context *,
diagnostic_info *)); diagnostic_info *);
extern void diagnostic_set_info PARAMS ((diagnostic_info *, extern void diagnostic_set_info (diagnostic_info *, const char *, va_list *,
const char *, va_list *, const char *, int, diagnostic_t);
const char *, int, extern char *diagnostic_build_prefix (diagnostic_info *);
diagnostic_t));
extern char *diagnostic_build_prefix PARAMS ((diagnostic_info *));
/* Pure text formatting support functions. */ /* Pure text formatting support functions. */
extern void init_output_buffer PARAMS ((output_buffer *, extern void init_output_buffer (output_buffer *, const char *, int);
const char *, int)); extern void output_clear (output_buffer *);
extern void output_clear PARAMS ((output_buffer *)); extern const char *output_last_position (const output_buffer *);
extern const char *output_last_position PARAMS ((const output_buffer *)); extern void output_set_prefix (output_buffer *, const char *);
extern void output_set_prefix PARAMS ((output_buffer *, extern void output_destroy_prefix (output_buffer *);
const char *)); extern void output_set_maximum_length (output_buffer *, int);
extern void output_destroy_prefix PARAMS ((output_buffer *)); extern void output_emit_prefix (output_buffer *);
extern void output_set_maximum_length PARAMS ((output_buffer *, int)); extern void output_add_newline (output_buffer *);
extern void output_emit_prefix PARAMS ((output_buffer *)); extern void output_add_space (output_buffer *);
extern void output_add_newline PARAMS ((output_buffer *)); extern int output_space_left (const output_buffer *);
extern void output_add_space PARAMS ((output_buffer *)); extern void output_append (output_buffer *, const char *, const char *);
extern int output_space_left PARAMS ((const output_buffer *)); extern void output_add_character (output_buffer *, int);
extern void output_append PARAMS ((output_buffer *, const char *, extern void output_decimal (output_buffer *, int);
const char *)); extern void output_add_string (output_buffer *, const char *);
extern void output_add_character PARAMS ((output_buffer *, int)); extern void output_add_identifier (output_buffer *, tree);
extern void output_decimal PARAMS ((output_buffer *, int)); extern const char *output_finalize_message (output_buffer *);
extern void output_add_string PARAMS ((output_buffer *, extern void output_clear_message_text (output_buffer *);
const char *)); extern void output_printf (output_buffer *, const char *, ...)
extern void output_add_identifier PARAMS ((output_buffer *, tree)); ATTRIBUTE_PRINTF_2;
extern const char *output_finalize_message PARAMS ((output_buffer *));
extern void output_clear_message_text PARAMS ((output_buffer *));
extern void output_printf PARAMS ((output_buffer *, const char *,
...)) ATTRIBUTE_PRINTF_2;
extern void output_verbatim (output_buffer *, const char *, ...); extern void output_verbatim (output_buffer *, const char *, ...);
extern void verbatim (const char *, ...); extern void verbatim (const char *, ...);
extern char *file_name_as_prefix PARAMS ((const char *)); extern char *file_name_as_prefix (const char *);
extern void inform PARAMS ((const char *, ...)); extern void inform (const char *, ...);
#endif /* ! GCC_DIAGNOSTIC_H */ #endif /* ! GCC_DIAGNOSTIC_H */
...@@ -65,25 +65,21 @@ static sreal real_zero, real_one, real_almost_one, real_br_prob_base, ...@@ -65,25 +65,21 @@ static sreal real_zero, real_one, real_almost_one, real_br_prob_base,
#define PROB_VERY_LIKELY (REG_BR_PROB_BASE - PROB_VERY_UNLIKELY) #define PROB_VERY_LIKELY (REG_BR_PROB_BASE - PROB_VERY_UNLIKELY)
#define PROB_ALWAYS (REG_BR_PROB_BASE) #define PROB_ALWAYS (REG_BR_PROB_BASE)
static bool predicted_by_p PARAMS ((basic_block, static bool predicted_by_p (basic_block, enum br_predictor);
enum br_predictor)); static void combine_predictions_for_insn (rtx, basic_block);
static void combine_predictions_for_insn PARAMS ((rtx, basic_block)); static void dump_prediction (enum br_predictor, int, basic_block, int);
static void dump_prediction PARAMS ((enum br_predictor, int, static void estimate_loops_at_level (struct loop *loop);
basic_block, int)); static void propagate_freq (struct loop *);
static void estimate_loops_at_level PARAMS ((struct loop *loop)); static void estimate_bb_frequencies (struct loops *);
static void propagate_freq PARAMS ((struct loop *)); static void counts_to_freqs (void);
static void estimate_bb_frequencies PARAMS ((struct loops *)); static void process_note_predictions (basic_block, int *, dominance_info,
static void counts_to_freqs PARAMS ((void)); dominance_info);
static void process_note_predictions PARAMS ((basic_block, int *, static void process_note_prediction (basic_block, int *, dominance_info,
dominance_info, dominance_info, int, int);
dominance_info)); static bool last_basic_block_p (basic_block);
static void process_note_prediction PARAMS ((basic_block, int *, static void compute_function_frequency (void);
dominance_info, static void choose_function_section (void);
dominance_info, int, int)); static bool can_predict_insn_p (rtx);
static bool last_basic_block_p PARAMS ((basic_block));
static void compute_function_frequency PARAMS ((void));
static void choose_function_section PARAMS ((void));
static bool can_predict_insn_p PARAMS ((rtx));
/* Information we hold about each branch predictor. /* Information we hold about each branch predictor.
Filled using information from predict.def. */ Filled using information from predict.def. */
...@@ -117,8 +113,7 @@ static const struct predictor_info predictor_info[]= { ...@@ -117,8 +113,7 @@ static const struct predictor_info predictor_info[]= {
for maximal performance. */ for maximal performance. */
bool bool
maybe_hot_bb_p (bb) maybe_hot_bb_p (basic_block bb)
basic_block bb;
{ {
if (profile_info && flag_branch_probabilities if (profile_info && flag_branch_probabilities
&& (bb->count && (bb->count
...@@ -132,8 +127,7 @@ maybe_hot_bb_p (bb) ...@@ -132,8 +127,7 @@ maybe_hot_bb_p (bb)
/* Return true in case BB is cold and should be optimized for size. */ /* Return true in case BB is cold and should be optimized for size. */
bool bool
probably_cold_bb_p (bb) probably_cold_bb_p (basic_block bb)
basic_block bb;
{ {
if (profile_info && flag_branch_probabilities if (profile_info && flag_branch_probabilities
&& (bb->count && (bb->count
...@@ -146,8 +140,7 @@ probably_cold_bb_p (bb) ...@@ -146,8 +140,7 @@ probably_cold_bb_p (bb)
/* Return true in case BB is probably never executed. */ /* Return true in case BB is probably never executed. */
bool bool
probably_never_executed_bb_p (bb) probably_never_executed_bb_p (basic_block bb)
basic_block bb;
{ {
if (profile_info && flag_branch_probabilities) if (profile_info && flag_branch_probabilities)
return ((bb->count + profile_info->runs / 2) / profile_info->runs) == 0; return ((bb->count + profile_info->runs / 2) / profile_info->runs) == 0;
...@@ -158,9 +151,7 @@ probably_never_executed_bb_p (bb) ...@@ -158,9 +151,7 @@ probably_never_executed_bb_p (bb)
PREDICTOR. */ PREDICTOR. */
static bool static bool
predicted_by_p (bb, predictor) predicted_by_p (basic_block bb, enum br_predictor predictor)
basic_block bb;
enum br_predictor predictor;
{ {
rtx note; rtx note;
if (!INSN_P (bb->end)) if (!INSN_P (bb->end))
...@@ -173,10 +164,7 @@ predicted_by_p (bb, predictor) ...@@ -173,10 +164,7 @@ predicted_by_p (bb, predictor)
} }
void void
predict_insn (insn, predictor, probability) predict_insn (rtx insn, enum br_predictor predictor, int probability)
rtx insn;
int probability;
enum br_predictor predictor;
{ {
if (!any_condjump_p (insn)) if (!any_condjump_p (insn))
abort (); abort ();
...@@ -194,10 +182,8 @@ predict_insn (insn, predictor, probability) ...@@ -194,10 +182,8 @@ predict_insn (insn, predictor, probability)
/* Predict insn by given predictor. */ /* Predict insn by given predictor. */
void void
predict_insn_def (insn, predictor, taken) predict_insn_def (rtx insn, enum br_predictor predictor,
rtx insn; enum prediction taken)
enum br_predictor predictor;
enum prediction taken;
{ {
int probability = predictor_info[(int) predictor].hitrate; int probability = predictor_info[(int) predictor].hitrate;
...@@ -210,10 +196,7 @@ predict_insn_def (insn, predictor, taken) ...@@ -210,10 +196,7 @@ predict_insn_def (insn, predictor, taken)
/* Predict edge E with given probability if possible. */ /* Predict edge E with given probability if possible. */
void void
predict_edge (e, predictor, probability) predict_edge (edge e, enum br_predictor predictor, int probability)
edge e;
int probability;
enum br_predictor predictor;
{ {
rtx last_insn; rtx last_insn;
last_insn = e->src->end; last_insn = e->src->end;
...@@ -234,8 +217,7 @@ predict_edge (e, predictor, probability) ...@@ -234,8 +217,7 @@ predict_edge (e, predictor, probability)
At the moment we represent predictions only on conditional At the moment we represent predictions only on conditional
jumps, not at computed jump or other complicated cases. */ jumps, not at computed jump or other complicated cases. */
static bool static bool
can_predict_insn_p (insn) can_predict_insn_p (rtx insn)
rtx insn;
{ {
return (GET_CODE (insn) == JUMP_INSN return (GET_CODE (insn) == JUMP_INSN
&& any_condjump_p (insn) && any_condjump_p (insn)
...@@ -245,10 +227,8 @@ can_predict_insn_p (insn) ...@@ -245,10 +227,8 @@ can_predict_insn_p (insn)
/* Predict edge E by given predictor if possible. */ /* Predict edge E by given predictor if possible. */
void void
predict_edge_def (e, predictor, taken) predict_edge_def (edge e, enum br_predictor predictor,
edge e; enum prediction taken)
enum br_predictor predictor;
enum prediction taken;
{ {
int probability = predictor_info[(int) predictor].hitrate; int probability = predictor_info[(int) predictor].hitrate;
...@@ -262,8 +242,7 @@ predict_edge_def (e, predictor, taken) ...@@ -262,8 +242,7 @@ predict_edge_def (e, predictor, taken)
to be done each time we invert the condition used by the jump. */ to be done each time we invert the condition used by the jump. */
void void
invert_br_probabilities (insn) invert_br_probabilities (rtx insn)
rtx insn;
{ {
rtx note; rtx note;
...@@ -278,11 +257,8 @@ invert_br_probabilities (insn) ...@@ -278,11 +257,8 @@ invert_br_probabilities (insn)
/* Dump information about the branch prediction to the output file. */ /* Dump information about the branch prediction to the output file. */
static void static void
dump_prediction (predictor, probability, bb, used) dump_prediction (enum br_predictor predictor, int probability,
enum br_predictor predictor; basic_block bb, int used)
int probability;
basic_block bb;
int used;
{ {
edge e = bb->succ; edge e = bb->succ;
...@@ -315,9 +291,7 @@ dump_prediction (predictor, probability, bb, used) ...@@ -315,9 +291,7 @@ dump_prediction (predictor, probability, bb, used)
note if not already present. Remove now useless REG_BR_PRED notes. */ note if not already present. Remove now useless REG_BR_PRED notes. */
static void static void
combine_predictions_for_insn (insn, bb) combine_predictions_for_insn (rtx insn, basic_block bb)
rtx insn;
basic_block bb;
{ {
rtx prob_note = find_reg_note (insn, REG_BR_PROB, 0); rtx prob_note = find_reg_note (insn, REG_BR_PROB, 0);
rtx *pnote = &REG_NOTES (insn); rtx *pnote = &REG_NOTES (insn);
...@@ -417,8 +391,7 @@ combine_predictions_for_insn (insn, bb) ...@@ -417,8 +391,7 @@ combine_predictions_for_insn (insn, bb)
predictions). */ predictions). */
void void
estimate_probability (loops_info) estimate_probability (struct loops *loops_info)
struct loops *loops_info;
{ {
dominance_info dominators, post_dominators; dominance_info dominators, post_dominators;
basic_block bb; basic_block bb;
...@@ -657,7 +630,7 @@ estimate_probability (loops_info) ...@@ -657,7 +630,7 @@ estimate_probability (loops_info)
values. */ values. */
void void
expected_value_to_br_prob () expected_value_to_br_prob (void)
{ {
rtx insn, cond, ev = NULL_RTX, ev_reg = NULL_RTX; rtx insn, cond, ev = NULL_RTX, ev_reg = NULL_RTX;
...@@ -725,11 +698,10 @@ expected_value_to_br_prob () ...@@ -725,11 +698,10 @@ expected_value_to_br_prob ()
} }
} }
/* Check whether this is the last basic block of function. Commonly tehre /* Check whether this is the last basic block of function. Commonly
is one extra common cleanup block. */ there is one extra common cleanup block. */
static bool static bool
last_basic_block_p (bb) last_basic_block_p (basic_block bb)
basic_block bb;
{ {
if (bb == EXIT_BLOCK_PTR) if (bb == EXIT_BLOCK_PTR)
return false; return false;
...@@ -740,20 +712,17 @@ last_basic_block_p (bb) ...@@ -740,20 +712,17 @@ last_basic_block_p (bb)
&& bb->succ->dest->next_bb == EXIT_BLOCK_PTR)); && bb->succ->dest->next_bb == EXIT_BLOCK_PTR));
} }
/* Sets branch probabilities according to PREDiction and FLAGS. HEADS[bb->index] /* Sets branch probabilities according to PREDiction and
should be index of basic block in that we need to alter branch predictions FLAGS. HEADS[bb->index] should be index of basic block in that we
(i.e. the first of our dominators such that we do not post-dominate it) need to alter branch predictions (i.e. the first of our dominators
(but we fill this information on demand, so -1 may be there in case this such that we do not post-dominate it) (but we fill this information
was not needed yet). */ on demand, so -1 may be there in case this was not needed yet). */
static void static void
process_note_prediction (bb, heads, dominators, post_dominators, pred, flags) process_note_prediction (basic_block bb, int *heads,
basic_block bb; dominance_info dominators,
int *heads; dominance_info post_dominators, int pred,
dominance_info dominators; int flags)
dominance_info post_dominators;
int pred;
int flags;
{ {
edge e; edge e;
int y; int y;
...@@ -809,11 +778,9 @@ process_note_prediction (bb, heads, dominators, post_dominators, pred, flags) ...@@ -809,11 +778,9 @@ process_note_prediction (bb, heads, dominators, post_dominators, pred, flags)
process_note_prediction. */ process_note_prediction. */
static void static void
process_note_predictions (bb, heads, dominators, post_dominators) process_note_predictions (basic_block bb, int *heads,
basic_block bb; dominance_info dominators,
int *heads; dominance_info post_dominators)
dominance_info dominators;
dominance_info post_dominators;
{ {
rtx insn; rtx insn;
edge e; edge e;
...@@ -871,7 +838,7 @@ process_note_predictions (bb, heads, dominators, post_dominators) ...@@ -871,7 +838,7 @@ process_note_predictions (bb, heads, dominators, post_dominators)
branch probabilities. */ branch probabilities. */
void void
note_prediction_to_br_prob () note_prediction_to_br_prob (void)
{ {
basic_block bb; basic_block bb;
dominance_info post_dominators, dominators; dominance_info post_dominators, dominators;
...@@ -936,8 +903,7 @@ typedef struct edge_info_def ...@@ -936,8 +903,7 @@ typedef struct edge_info_def
Propagate the frequencies for LOOP. */ Propagate the frequencies for LOOP. */
static void static void
propagate_freq (loop) propagate_freq (struct loop *loop)
struct loop *loop;
{ {
basic_block head = loop->header; basic_block head = loop->header;
basic_block bb; basic_block bb;
...@@ -1019,7 +985,7 @@ propagate_freq (loop) ...@@ -1019,7 +985,7 @@ propagate_freq (loop)
sizeof (real_almost_one)); sizeof (real_almost_one));
} }
/* BLOCK_INFO (bb)->frequency = frequency /* BLOCK_INFO (bb)->frequency = frequency
/ (1 - cyclic_probability) */ / (1 - cyclic_probability) */
sreal_sub (&cyclic_probability, &real_one, &cyclic_probability); sreal_sub (&cyclic_probability, &real_one, &cyclic_probability);
...@@ -1068,8 +1034,7 @@ propagate_freq (loop) ...@@ -1068,8 +1034,7 @@ propagate_freq (loop)
/* Estimate probabilities of loopback edges in loops at same nest level. */ /* Estimate probabilities of loopback edges in loops at same nest level. */
static void static void
estimate_loops_at_level (first_loop) estimate_loops_at_level (struct loop *first_loop)
struct loop *first_loop;
{ {
struct loop *loop; struct loop *loop;
...@@ -1080,7 +1045,7 @@ estimate_loops_at_level (first_loop) ...@@ -1080,7 +1045,7 @@ estimate_loops_at_level (first_loop)
unsigned i; unsigned i;
estimate_loops_at_level (loop->inner); estimate_loops_at_level (loop->inner);
if (loop->latch->succ) /* Do not do this for dummy function loop. */ if (loop->latch->succ) /* Do not do this for dummy function loop. */
{ {
/* Find current loop back edge and mark it. */ /* Find current loop back edge and mark it. */
...@@ -1099,7 +1064,7 @@ estimate_loops_at_level (first_loop) ...@@ -1099,7 +1064,7 @@ estimate_loops_at_level (first_loop)
/* Convert counts measured by profile driven feedback to frequencies. */ /* Convert counts measured by profile driven feedback to frequencies. */
static void static void
counts_to_freqs () counts_to_freqs (void)
{ {
gcov_type count_max = 1; gcov_type count_max = 1;
basic_block bb; basic_block bb;
...@@ -1117,8 +1082,7 @@ counts_to_freqs () ...@@ -1117,8 +1082,7 @@ counts_to_freqs ()
function can execute at average to be still considered not expensive. */ function can execute at average to be still considered not expensive. */
bool bool
expensive_function_p (threshold) expensive_function_p (int threshold)
int threshold;
{ {
unsigned int sum = 0; unsigned int sum = 0;
basic_block bb; basic_block bb;
...@@ -1157,8 +1121,7 @@ expensive_function_p (threshold) ...@@ -1157,8 +1121,7 @@ expensive_function_p (threshold)
/* Estimate basic blocks frequency by given branch probabilities. */ /* Estimate basic blocks frequency by given branch probabilities. */
static void static void
estimate_bb_frequencies (loops) estimate_bb_frequencies (struct loops *loops)
struct loops *loops;
{ {
basic_block bb; basic_block bb;
sreal freq_max; sreal freq_max;
...@@ -1256,7 +1219,7 @@ estimate_bb_frequencies (loops) ...@@ -1256,7 +1219,7 @@ estimate_bb_frequencies (loops)
/* Decide whether function is hot, cold or unlikely executed. */ /* Decide whether function is hot, cold or unlikely executed. */
static void static void
compute_function_frequency () compute_function_frequency (void)
{ {
basic_block bb; basic_block bb;
...@@ -1277,12 +1240,12 @@ compute_function_frequency () ...@@ -1277,12 +1240,12 @@ compute_function_frequency ()
/* Choose appropriate section for the function. */ /* Choose appropriate section for the function. */
static void static void
choose_function_section () choose_function_section (void)
{ {
if (DECL_SECTION_NAME (current_function_decl) if (DECL_SECTION_NAME (current_function_decl)
|| !targetm.have_named_sections || !targetm.have_named_sections
/* Theoretically we can split the gnu.linkonce text section too, /* Theoretically we can split the gnu.linkonce text section too,
but this requires more work as the frequency needs to match but this requires more work as the frequency needs to match
for all generated objects so we need to merge the frequency for all generated objects so we need to merge the frequency
of all instances. For now just never set frequency for these. */ of all instances. For now just never set frequency for these. */
|| DECL_ONE_ONLY (current_function_decl)) || DECL_ONE_ONLY (current_function_decl))
......
/* This file contains the definitions and documentation for the /* This file contains the definitions and documentation for the
builtins used in the GNU compiler. builtins used in the GNU compiler.
Copyright (C) 2001 Free Software Foundation, Inc. Copyright (C) 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -37,13 +37,11 @@ enum prediction ...@@ -37,13 +37,11 @@ enum prediction
/* Flags for NOTE_PREDICTION */ /* Flags for NOTE_PREDICTION */
#define IS_TAKEN 1 /* Predict edges to the block as taken. */ #define IS_TAKEN 1 /* Predict edges to the block as taken. */
extern void predict_insn_def PARAMS ((rtx, enum br_predictor, extern void predict_insn_def (rtx, enum br_predictor, enum prediction);
enum prediction)); extern void predict_insn (rtx, enum br_predictor, int);
extern void predict_insn PARAMS ((rtx, enum br_predictor, int));
/* Avoid unneeded dependency on basic_block.h */ /* Avoid unneeded dependency on basic_block.h */
#ifdef BASIC_BLOCK #ifdef BASIC_BLOCK
extern void predict_edge PARAMS ((edge, enum br_predictor, int)); extern void predict_edge (edge, enum br_predictor, int);
extern void predict_edge_def PARAMS ((edge, enum br_predictor, extern void predict_edge_def (edge, enum br_predictor, enum prediction);
enum prediction));
#endif #endif
...@@ -2087,12 +2087,12 @@ extern rtx delete_insn_and_edges PARAMS ((rtx)); ...@@ -2087,12 +2087,12 @@ extern rtx delete_insn_and_edges PARAMS ((rtx));
extern void delete_insn_chain_and_edges PARAMS ((rtx, rtx)); extern void delete_insn_chain_and_edges PARAMS ((rtx, rtx));
/* In combine.c */ /* In combine.c */
extern int combine_instructions PARAMS ((rtx, unsigned int)); extern int combine_instructions (rtx, unsigned int);
extern unsigned int extended_count PARAMS ((rtx, enum machine_mode, int)); extern unsigned int extended_count (rtx, enum machine_mode, int);
extern rtx remove_death PARAMS ((unsigned int, rtx)); extern rtx remove_death (unsigned int, rtx);
#ifdef BUFSIZ #ifdef BUFSIZ
extern void dump_combine_stats PARAMS ((FILE *)); extern void dump_combine_stats (FILE *);
extern void dump_combine_total_stats PARAMS ((FILE *)); extern void dump_combine_total_stats (FILE *);
#endif #endif
/* In sched.c. */ /* In sched.c. */
......
...@@ -30,21 +30,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -30,21 +30,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-dump.h" #include "tree-dump.h"
#include "langhooks.h" #include "langhooks.h"
static unsigned int queue PARAMS ((dump_info_p, tree, int)); static unsigned int queue (dump_info_p, tree, int);
static void dump_index PARAMS ((dump_info_p, unsigned int)); static void dump_index (dump_info_p, unsigned int);
static void dequeue_and_dump PARAMS ((dump_info_p)); static void dequeue_and_dump (dump_info_p);
static void dump_new_line PARAMS ((dump_info_p)); static void dump_new_line (dump_info_p);
static void dump_maybe_newline PARAMS ((dump_info_p)); static void dump_maybe_newline (dump_info_p);
static void dump_string_field PARAMS ((dump_info_p, const char *, const char *)); static void dump_string_field (dump_info_p, const char *, const char *);
/* Add T to the end of the queue of nodes to dump. Returns the index /* Add T to the end of the queue of nodes to dump. Returns the index
assigned to T. */ assigned to T. */
static unsigned int static unsigned int
queue (di, t, flags) queue (dump_info_p di, tree t, int flags)
dump_info_p di;
tree t;
int flags;
{ {
dump_queue_p dq; dump_queue_p dq;
dump_node_info_p dni; dump_node_info_p dni;
...@@ -82,9 +79,7 @@ queue (di, t, flags) ...@@ -82,9 +79,7 @@ queue (di, t, flags)
} }
static void static void
dump_index (di, index) dump_index (dump_info_p di, unsigned int index)
dump_info_p di;
unsigned int index;
{ {
fprintf (di->stream, "@%-6u ", index); fprintf (di->stream, "@%-6u ", index);
di->column += 8; di->column += 8;
...@@ -95,11 +90,7 @@ dump_index (di, index) ...@@ -95,11 +90,7 @@ dump_index (di, index)
index of T is printed. */ index of T is printed. */
void void
queue_and_dump_index (di, field, t, flags) queue_and_dump_index (dump_info_p di, const char *field, tree t, int flags)
dump_info_p di;
const char *field;
tree t;
int flags;
{ {
unsigned int index; unsigned int index;
splay_tree_node n; splay_tree_node n;
...@@ -127,9 +118,7 @@ queue_and_dump_index (di, field, t, flags) ...@@ -127,9 +118,7 @@ queue_and_dump_index (di, field, t, flags)
/* Dump the type of T. */ /* Dump the type of T. */
void void
queue_and_dump_type (di, t) queue_and_dump_type (dump_info_p di, tree t)
dump_info_p di;
tree t;
{ {
queue_and_dump_index (di, "type", TREE_TYPE (t), DUMP_NONE); queue_and_dump_index (di, "type", TREE_TYPE (t), DUMP_NONE);
} }
...@@ -143,8 +132,7 @@ queue_and_dump_type (di, t) ...@@ -143,8 +132,7 @@ queue_and_dump_type (di, t)
place to start printing more fields. */ place to start printing more fields. */
static void static void
dump_new_line (di) dump_new_line (dump_info_p di)
dump_info_p di;
{ {
fprintf (di->stream, "\n%*s", SOL_COLUMN, ""); fprintf (di->stream, "\n%*s", SOL_COLUMN, "");
di->column = SOL_COLUMN; di->column = SOL_COLUMN;
...@@ -153,8 +141,7 @@ dump_new_line (di) ...@@ -153,8 +141,7 @@ dump_new_line (di)
/* If necessary, insert a new line. */ /* If necessary, insert a new line. */
static void static void
dump_maybe_newline (di) dump_maybe_newline (dump_info_p di)
dump_info_p di;
{ {
int extra; int extra;
...@@ -172,10 +159,7 @@ dump_maybe_newline (di) ...@@ -172,10 +159,7 @@ dump_maybe_newline (di)
/* Dump pointer PTR using FIELD to identify it. */ /* Dump pointer PTR using FIELD to identify it. */
void void
dump_pointer (di, field, ptr) dump_pointer (dump_info_p di, const char *field, void *ptr)
dump_info_p di;
const char *field;
void *ptr;
{ {
dump_maybe_newline (di); dump_maybe_newline (di);
fprintf (di->stream, "%-4s: %-8lx ", field, (long) ptr); fprintf (di->stream, "%-4s: %-8lx ", field, (long) ptr);
...@@ -185,10 +169,7 @@ dump_pointer (di, field, ptr) ...@@ -185,10 +169,7 @@ dump_pointer (di, field, ptr)
/* Dump integer I using FIELD to identify it. */ /* Dump integer I using FIELD to identify it. */
void void
dump_int (di, field, i) dump_int (dump_info_p di, const char *field, int i)
dump_info_p di;
const char *field;
int i;
{ {
dump_maybe_newline (di); dump_maybe_newline (di);
fprintf (di->stream, "%-4s: %-7d ", field, i); fprintf (di->stream, "%-4s: %-7d ", field, i);
...@@ -198,9 +179,7 @@ dump_int (di, field, i) ...@@ -198,9 +179,7 @@ dump_int (di, field, i)
/* Dump the string S. */ /* Dump the string S. */
void void
dump_string (di, string) dump_string (dump_info_p di, const char *string)
dump_info_p di;
const char *string;
{ {
dump_maybe_newline (di); dump_maybe_newline (di);
fprintf (di->stream, "%-13s ", string); fprintf (di->stream, "%-13s ", string);
...@@ -213,10 +192,7 @@ dump_string (di, string) ...@@ -213,10 +192,7 @@ dump_string (di, string)
/* Dump the string field S. */ /* Dump the string field S. */
static void static void
dump_string_field (di, field, string) dump_string_field (dump_info_p di, const char *field, const char *string)
dump_info_p di;
const char *field;
const char *string;
{ {
dump_maybe_newline (di); dump_maybe_newline (di);
fprintf (di->stream, "%-4s: %-7s ", field, string); fprintf (di->stream, "%-4s: %-7s ", field, string);
...@@ -229,8 +205,7 @@ dump_string_field (di, field, string) ...@@ -229,8 +205,7 @@ dump_string_field (di, field, string)
/* Dump the next node in the queue. */ /* Dump the next node in the queue. */
static void static void
dequeue_and_dump (di) dequeue_and_dump (dump_info_p di)
dump_info_p di;
{ {
dump_queue_p dq; dump_queue_p dq;
splay_tree_node stn; splay_tree_node stn;
...@@ -277,7 +252,7 @@ dequeue_and_dump (di) ...@@ -277,7 +252,7 @@ dequeue_and_dump (di)
tree bases = BINFO_BASETYPES (t); tree bases = BINFO_BASETYPES (t);
unsigned n_bases = bases ? TREE_VEC_LENGTH (bases): 0; unsigned n_bases = bases ? TREE_VEC_LENGTH (bases): 0;
tree accesses = BINFO_BASEACCESSES (t); tree accesses = BINFO_BASEACCESSES (t);
dump_child ("type", BINFO_TYPE (t)); dump_child ("type", BINFO_TYPE (t));
if (TREE_VIA_VIRTUAL (t)) if (TREE_VIA_VIRTUAL (t))
...@@ -299,11 +274,11 @@ dequeue_and_dump (di) ...@@ -299,11 +274,11 @@ dequeue_and_dump (di)
string = "priv"; string = "priv";
else else
abort (); abort ();
dump_string (di, string); dump_string (di, string);
queue_and_dump_index (di, "binf", base, DUMP_BINFO); queue_and_dump_index (di, "binf", base, DUMP_BINFO);
} }
goto done; goto done;
} }
...@@ -616,10 +591,7 @@ dequeue_and_dump (di) ...@@ -616,10 +591,7 @@ dequeue_and_dump (di)
/* Return nonzero if FLAG has been specified for the dump, and NODE /* Return nonzero if FLAG has been specified for the dump, and NODE
is not the root node of the dump. */ is not the root node of the dump. */
int dump_flag (di, flag, node) int dump_flag (dump_info_p di, int flag, tree node)
dump_info_p di;
int flag;
tree node;
{ {
return (di->flags & flag) && (node != di->node); return (di->flags & flag) && (node != di->node);
} }
...@@ -627,10 +599,7 @@ int dump_flag (di, flag, node) ...@@ -627,10 +599,7 @@ int dump_flag (di, flag, node)
/* Dump T, and all its children, on STREAM. */ /* Dump T, and all its children, on STREAM. */
void void
dump_node (t, flags, stream) dump_node (tree t, int flags, FILE *stream)
tree t;
int flags;
FILE *stream;
{ {
struct dump_info di; struct dump_info di;
dump_queue_p dq; dump_queue_p dq;
...@@ -707,9 +676,7 @@ static const struct dump_option_value_info dump_options[] = ...@@ -707,9 +676,7 @@ static const struct dump_option_value_info dump_options[] =
Multiple calls will reopen and append to the dump file. */ Multiple calls will reopen and append to the dump file. */
FILE * FILE *
dump_begin (phase, flag_ptr) dump_begin (enum tree_dump_index phase, int *flag_ptr)
enum tree_dump_index phase;
int *flag_ptr;
{ {
FILE *stream; FILE *stream;
char *name; char *name;
...@@ -733,8 +700,7 @@ dump_begin (phase, flag_ptr) ...@@ -733,8 +700,7 @@ dump_begin (phase, flag_ptr)
/* Returns nonzero if tree dump PHASE is enabled. */ /* Returns nonzero if tree dump PHASE is enabled. */
int int
dump_enabled_p (phase) dump_enabled_p (enum tree_dump_index phase)
enum tree_dump_index phase;
{ {
return dump_files[phase].state; return dump_files[phase].state;
} }
...@@ -742,8 +708,7 @@ dump_enabled_p (phase) ...@@ -742,8 +708,7 @@ dump_enabled_p (phase)
/* Returns the switch name of PHASE. */ /* Returns the switch name of PHASE. */
const char * const char *
dump_flag_name (phase) dump_flag_name (enum tree_dump_index phase)
enum tree_dump_index phase;
{ {
return dump_files[phase].swtch; return dump_files[phase].swtch;
} }
...@@ -752,9 +717,7 @@ dump_flag_name (phase) ...@@ -752,9 +717,7 @@ dump_flag_name (phase)
dump_begin. */ dump_begin. */
void void
dump_end (phase, stream) dump_end (enum tree_dump_index phase ATTRIBUTE_UNUSED, FILE *stream)
enum tree_dump_index phase ATTRIBUTE_UNUSED;
FILE *stream;
{ {
fclose (stream); fclose (stream);
} }
...@@ -763,8 +726,7 @@ dump_end (phase, stream) ...@@ -763,8 +726,7 @@ dump_end (phase, stream)
relevant details in the dump_files array. */ relevant details in the dump_files array. */
int int
dump_switch_p (arg) dump_switch_p (const char *arg)
const char *arg;
{ {
unsigned ix; unsigned ix;
const char *option_value; const char *option_value;
......
/* Tree-dumping functionality for intermediate representation. /* Tree-dumping functionality for intermediate representation.
Copyright (C) 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com> Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GCC. This file is part of GCC.
...@@ -77,19 +77,12 @@ struct dump_info ...@@ -77,19 +77,12 @@ struct dump_info
#define dump_child(field, child) \ #define dump_child(field, child) \
queue_and_dump_index (di, field, child, DUMP_NONE) queue_and_dump_index (di, field, child, DUMP_NONE)
extern void dump_pointer extern void dump_pointer (dump_info_p, const char *, void *);
PARAMS ((dump_info_p, const char *, void *)); extern void dump_int (dump_info_p, const char *, int);
extern void dump_int extern void dump_string (dump_info_p, const char *);
PARAMS ((dump_info_p, const char *, int)); extern void dump_stmt (dump_info_p, tree);
extern void dump_string extern void dump_next_stmt (dump_info_p, tree);
PARAMS ((dump_info_p, const char *)); extern void queue_and_dump_index (dump_info_p, const char *, tree, int);
extern void dump_stmt extern void queue_and_dump_type (dump_info_p, tree);
PARAMS ((dump_info_p, tree));
extern void dump_next_stmt
PARAMS ((dump_info_p, tree));
extern void queue_and_dump_index
PARAMS ((dump_info_p, const char *, tree, int));
extern void queue_and_dump_type
PARAMS ((dump_info_p, tree));
#endif /* ! GCC_TREE_DUMP_H */ #endif /* ! GCC_TREE_DUMP_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment