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