tree-cfg.c: Prune whitespace.
* tree-cfg.c: Prune whitespace. (debug_tree_cfg): Point to correct header containing the TDF_* defines. From-SVN: r113954
This commit is contained in:
parent
95a52ebb0b
commit
6531d1be90
@ -1,3 +1,9 @@
|
||||
2006-05-21 Bernhard Fischer <aldot@gcc.gnu.org>
|
||||
|
||||
* tree-cfg.c: Prune whitespace.
|
||||
(debug_tree_cfg): Point to correct header containing the
|
||||
TDF_* defines.
|
||||
|
||||
2006-05-21 Bernhard Fischer <aldot@gcc.gnu.org>
|
||||
|
||||
PR middle-end/25776
|
||||
|
118
gcc/tree-cfg.c
118
gcc/tree-cfg.c
@ -247,9 +247,9 @@ struct tree_opt_pass pass_build_cfg =
|
||||
0 /* letter */
|
||||
};
|
||||
|
||||
/* Search the CFG for any computed gotos. If found, factor them to a
|
||||
/* Search the CFG for any computed gotos. If found, factor them to a
|
||||
common computed goto site. Also record the location of that site so
|
||||
that we can un-factor the gotos after we have converted back to
|
||||
that we can un-factor the gotos after we have converted back to
|
||||
normal form. */
|
||||
|
||||
static void
|
||||
@ -264,7 +264,7 @@ factor_computed_gotos (void)
|
||||
/* We know there are one or more computed gotos in this function.
|
||||
Examine the last statement in each basic block to see if the block
|
||||
ends with a computed goto. */
|
||||
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
block_stmt_iterator bsi = bsi_last (bb);
|
||||
@ -565,7 +565,7 @@ make_edges (void)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
@ -658,7 +658,7 @@ edge_to_cases_eq (const void *p1, const void *p2)
|
||||
/* Called for each element in the hash table (P) as we delete the
|
||||
edge to cases hash table.
|
||||
|
||||
Clear all the TREE_CHAINs to prevent problems with copying of
|
||||
Clear all the TREE_CHAINs to prevent problems with copying of
|
||||
SWITCH_EXPRs and structure sharing rules, then free the hash table
|
||||
element. */
|
||||
|
||||
@ -759,7 +759,7 @@ get_cases_for_edge (edge e, tree t)
|
||||
chains available. Return NULL so the caller can detect this case. */
|
||||
if (!recording_case_labels_p ())
|
||||
return NULL;
|
||||
|
||||
|
||||
restart:
|
||||
elt.e = e;
|
||||
elt.case_labels = NULL;
|
||||
@ -821,7 +821,7 @@ label_to_block_fn (struct function *ifun, tree dest)
|
||||
and undefined variable warnings quite right. */
|
||||
if ((errorcount || sorrycount) && uid < 0)
|
||||
{
|
||||
block_stmt_iterator bsi =
|
||||
block_stmt_iterator bsi =
|
||||
bsi_start (BASIC_BLOCK (NUM_FIXED_BLOCKS));
|
||||
tree stmt;
|
||||
|
||||
@ -1025,13 +1025,13 @@ cleanup_dead_labels (void)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SWITCH_EXPR:
|
||||
{
|
||||
size_t i;
|
||||
tree vec = SWITCH_LABELS (stmt);
|
||||
size_t n = TREE_VEC_LENGTH (vec);
|
||||
|
||||
|
||||
/* Replace all destination labels. */
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
@ -1111,7 +1111,7 @@ group_case_labels (void)
|
||||
int old_size = TREE_VEC_LENGTH (labels);
|
||||
int i, j, new_size = old_size;
|
||||
tree default_case = TREE_VEC_ELT (labels, old_size - 1);
|
||||
tree default_label;
|
||||
tree default_label;
|
||||
|
||||
/* The default label is always the last case in a switch
|
||||
statement after gimplification. */
|
||||
@ -1205,7 +1205,7 @@ tree_can_merge_blocks_p (basic_block a, basic_block b)
|
||||
|
||||
if (b == EXIT_BLOCK_PTR)
|
||||
return false;
|
||||
|
||||
|
||||
/* If A ends by a statement causing exceptions or something similar, we
|
||||
cannot merge the blocks. */
|
||||
stmt = last_stmt (a);
|
||||
@ -1293,7 +1293,7 @@ replace_uses_by (tree name, tree val)
|
||||
mark_new_vars_to_rename (stmt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gcc_assert (num_imm_uses (name) == 0);
|
||||
|
||||
/* Also update the trees stored in loop structures. */
|
||||
@ -1402,24 +1402,23 @@ tree_merge_blocks (basic_block a, basic_block b)
|
||||
reached by a complex edge, if there is one. Else, return BB. We use
|
||||
this in optimizations that use post-dominators for their heuristics,
|
||||
to catch the cases in C++ where function calls are involved. */
|
||||
|
||||
|
||||
basic_block
|
||||
single_noncomplex_succ (basic_block bb)
|
||||
single_noncomplex_succ (basic_block bb)
|
||||
{
|
||||
edge e0, e1;
|
||||
if (EDGE_COUNT (bb->succs) != 2)
|
||||
return bb;
|
||||
|
||||
|
||||
e0 = EDGE_SUCC (bb, 0);
|
||||
e1 = EDGE_SUCC (bb, 1);
|
||||
if (e0->flags & EDGE_COMPLEX)
|
||||
return e1->dest;
|
||||
if (e1->flags & EDGE_COMPLEX)
|
||||
return e0->dest;
|
||||
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Walk the function tree removing unnecessary statements.
|
||||
@ -1798,7 +1797,7 @@ remove_useless_stmts_label (tree *stmt_p, struct rus_data *data)
|
||||
|
||||
/* If the function is "const" or "pure", then clear TREE_SIDE_EFFECTS on its
|
||||
decl. This allows us to eliminate redundant or useless
|
||||
calls to "const" functions.
|
||||
calls to "const" functions.
|
||||
|
||||
Gimplifier already does the same operation, but we may notice functions
|
||||
being const and pure once their calls has been gimplified, so we need
|
||||
@ -1912,7 +1911,7 @@ remove_useless_stmts_1 (tree *tp, struct rus_data *data)
|
||||
tsi_delink (&i);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
remove_useless_stmts_1 (tsi_stmt_ptr (i), data);
|
||||
|
||||
t = tsi_stmt (i);
|
||||
@ -1954,7 +1953,7 @@ remove_useless_stmts (void)
|
||||
}
|
||||
|
||||
|
||||
struct tree_opt_pass pass_remove_useless_stmts =
|
||||
struct tree_opt_pass pass_remove_useless_stmts =
|
||||
{
|
||||
"useless", /* name */
|
||||
NULL, /* gate */
|
||||
@ -2055,7 +2054,7 @@ remove_bb (basic_block bb)
|
||||
DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)) = 0;
|
||||
FORCED_LABEL (LABEL_EXPR_LABEL (stmt)) = 1;
|
||||
}
|
||||
|
||||
|
||||
new_bb = bb->prev_bb;
|
||||
new_bsi = bsi_start (new_bb);
|
||||
bsi_remove (&i, false);
|
||||
@ -2167,7 +2166,7 @@ find_taken_edge_cond_expr (basic_block bb, tree val)
|
||||
edge true_edge, false_edge;
|
||||
|
||||
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
|
||||
|
||||
|
||||
gcc_assert (TREE_CODE (val) == INTEGER_CST);
|
||||
return (zero_p (val) ? false_edge : true_edge);
|
||||
}
|
||||
@ -2267,13 +2266,13 @@ debug_tree_bb_n (int n)
|
||||
{
|
||||
debug_tree_bb (BASIC_BLOCK (n));
|
||||
return BASIC_BLOCK (n);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Dump the CFG on stderr.
|
||||
|
||||
FLAGS are the same used by the tree dumping functions
|
||||
(see TDF_* in tree.h). */
|
||||
(see TDF_* in tree-pass.h). */
|
||||
|
||||
void
|
||||
debug_tree_cfg (int flags)
|
||||
@ -2838,7 +2837,7 @@ bsi_insert_after (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
|
||||
|
||||
|
||||
/* Remove the statement pointed to by iterator I. The iterator is updated
|
||||
to the next statement.
|
||||
to the next statement.
|
||||
|
||||
When REMOVE_EH_INFO is true we remove the statement pointed to by
|
||||
iterator I from the EH tables. Otherwise we do not modify the EH
|
||||
@ -2862,18 +2861,18 @@ bsi_remove (block_stmt_iterator *i, bool remove_eh_info)
|
||||
|
||||
/* Move the statement at FROM so it comes right after the statement at TO. */
|
||||
|
||||
void
|
||||
void
|
||||
bsi_move_after (block_stmt_iterator *from, block_stmt_iterator *to)
|
||||
{
|
||||
tree stmt = bsi_stmt (*from);
|
||||
bsi_remove (from, false);
|
||||
bsi_insert_after (to, stmt, BSI_SAME_STMT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Move the statement at FROM so it comes right before the statement at TO. */
|
||||
|
||||
void
|
||||
void
|
||||
bsi_move_before (block_stmt_iterator *from, block_stmt_iterator *to)
|
||||
{
|
||||
tree stmt = bsi_stmt (*from);
|
||||
@ -2888,7 +2887,7 @@ void
|
||||
bsi_move_to_bb_end (block_stmt_iterator *from, basic_block bb)
|
||||
{
|
||||
block_stmt_iterator last = bsi_last (bb);
|
||||
|
||||
|
||||
/* Have to check bsi_end_p because it could be an empty block. */
|
||||
if (!bsi_end_p (last) && is_ctrl_stmt (bsi_stmt (last)))
|
||||
bsi_move_before (from, &last);
|
||||
@ -2900,7 +2899,6 @@ bsi_move_to_bb_end (block_stmt_iterator *from, basic_block bb)
|
||||
/* Replace the contents of the statement pointed to by iterator BSI
|
||||
with STMT. If UPDATE_EH_INFO is true, the exception handling
|
||||
information of the original statement is moved to the new statement. */
|
||||
|
||||
|
||||
void
|
||||
bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool update_eh_info)
|
||||
@ -2951,7 +2949,7 @@ tree_find_edge_insert_loc (edge e, block_stmt_iterator *bsi,
|
||||
restart:
|
||||
|
||||
/* If the destination has one predecessor which has no PHI nodes,
|
||||
insert there. Except for the exit block.
|
||||
insert there. Except for the exit block.
|
||||
|
||||
The requirement for no PHI nodes could be relaxed. Basically we
|
||||
would have to examine the PHIs to prove that none of them used
|
||||
@ -3107,7 +3105,7 @@ reinstall_phi_args (edge new_edge, edge old_edge)
|
||||
|
||||
if (!PENDING_STMT (old_edge))
|
||||
return;
|
||||
|
||||
|
||||
for (var = PENDING_STMT (old_edge), phi = phi_nodes (new_edge->dest);
|
||||
var && phi;
|
||||
var = TREE_CHAIN (var), phi = PHI_CHAIN (phi))
|
||||
@ -3202,7 +3200,7 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
|
||||
|
||||
if (TYPE_P (t))
|
||||
*walk_subtrees = 0;
|
||||
|
||||
|
||||
/* Check operand N for being valid GIMPLE and give error MSG if not. */
|
||||
#define CHECK_OP(N, MSG) \
|
||||
do { if (!is_gimple_val (TREE_OPERAND (t, N))) \
|
||||
@ -3793,11 +3791,11 @@ tree_verify_flow_info (void)
|
||||
if (simple_goto_p (stmt))
|
||||
{
|
||||
error ("explicit goto at end of bb %d", bb->index);
|
||||
err = 1;
|
||||
err = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME. We should double check that the labels in the
|
||||
/* FIXME. We should double check that the labels in the
|
||||
destination blocks have their address taken. */
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
if ((e->flags & (EDGE_FALLTHRU | EDGE_TRUE_VALUE
|
||||
@ -4049,7 +4047,7 @@ tree_redirect_edge_and_branch (edge e, basic_block dest)
|
||||
if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
|
||||
return NULL;
|
||||
|
||||
if (e->src != ENTRY_BLOCK_PTR
|
||||
if (e->src != ENTRY_BLOCK_PTR
|
||||
&& (ret = tree_try_redirect_by_replacing_jump (e, dest)))
|
||||
return ret;
|
||||
|
||||
@ -4296,7 +4294,7 @@ add_phi_args_after_copy_bb (basic_block bb_copy)
|
||||
edge e, e_copy;
|
||||
edge_iterator ei;
|
||||
tree phi, phi_copy, phi_next, def;
|
||||
|
||||
|
||||
bb = get_bb_original (bb_copy);
|
||||
|
||||
FOR_EACH_EDGE (e_copy, ei, bb_copy->succs)
|
||||
@ -4458,7 +4456,7 @@ tree_duplicate_sese_region (edge entry, edge exit,
|
||||
total_count - entry_count,
|
||||
total_count);
|
||||
scale_bbs_frequencies_gcov_type (region_copy, n_region, entry_count,
|
||||
total_count);
|
||||
total_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4610,7 +4608,7 @@ move_stmt_r (tree *tp, int *walk_subtrees, void *data)
|
||||
original array of blocks and placed in DEST_FN's array of blocks.
|
||||
If UPDATE_EDGE_COUNT_P is true, the edge counts on both CFGs is
|
||||
updated to reflect the moved edges.
|
||||
|
||||
|
||||
On exit, local variables that need to be removed from
|
||||
CFUN->UNEXPANDED_VAR_LIST will have been added to VARS_TO_REMOVE. */
|
||||
|
||||
@ -4728,7 +4726,7 @@ find_outermost_region_in_block (struct function *src_cfun,
|
||||
basic_block bb, int region)
|
||||
{
|
||||
block_stmt_iterator si;
|
||||
|
||||
|
||||
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
|
||||
{
|
||||
tree stmt = bsi_stmt (si);
|
||||
@ -4971,7 +4969,7 @@ dump_function_to_file (tree fn, FILE *file, int flags)
|
||||
basic_block bb;
|
||||
tree chain;
|
||||
struct function *saved_cfun;
|
||||
|
||||
|
||||
fprintf (file, "%s (", lang_hooks.decl_printable_name (fn, 2));
|
||||
|
||||
arg = DECL_ARGUMENTS (fn);
|
||||
@ -5026,7 +5024,7 @@ dump_function_to_file (tree fn, FILE *file, int flags)
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
dump_generic_bb (file, bb, 2, flags);
|
||||
|
||||
|
||||
fprintf (file, "}\n");
|
||||
check_bb_profile (EXIT_BLOCK_PTR, file);
|
||||
}
|
||||
@ -5117,7 +5115,7 @@ print_loop (FILE *file, struct loop *loop, int indent)
|
||||
{
|
||||
char *s_indent;
|
||||
basic_block bb;
|
||||
|
||||
|
||||
if (loop == NULL)
|
||||
return;
|
||||
|
||||
@ -5127,7 +5125,7 @@ print_loop (FILE *file, struct loop *loop, int indent)
|
||||
|
||||
/* Print the loop's header. */
|
||||
fprintf (file, "%sloop_%d\n", s_indent, loop->num);
|
||||
|
||||
|
||||
/* Print the loop's body. */
|
||||
fprintf (file, "%s{\n", s_indent);
|
||||
FOR_EACH_BB (bb)
|
||||
@ -5139,13 +5137,13 @@ print_loop (FILE *file, struct loop *loop, int indent)
|
||||
fprintf (file, "}, succs = {");
|
||||
print_succ_bbs (file, bb);
|
||||
fprintf (file, "})\n");
|
||||
|
||||
|
||||
/* Print the basic_block's body. */
|
||||
fprintf (file, "%s {\n", s_indent);
|
||||
tree_dump_bb (bb, file, indent + 4);
|
||||
fprintf (file, "%s }\n", s_indent);
|
||||
}
|
||||
|
||||
|
||||
print_loop (file, loop->inner, indent + 2);
|
||||
fprintf (file, "%s}\n", s_indent);
|
||||
print_loop (file, loop->next, indent);
|
||||
@ -5155,11 +5153,11 @@ print_loop (FILE *file, struct loop *loop, int indent)
|
||||
/* Follow a CFG edge from the entry point of the program, and on entry
|
||||
of a loop, pretty print the loop structure on FILE. */
|
||||
|
||||
void
|
||||
void
|
||||
print_loop_ir (FILE *file)
|
||||
{
|
||||
basic_block bb;
|
||||
|
||||
|
||||
bb = BASIC_BLOCK (NUM_FIXED_BLOCKS);
|
||||
if (bb && bb->loop_father)
|
||||
print_loop (file, bb->loop_father, 0);
|
||||
@ -5168,7 +5166,7 @@ print_loop_ir (FILE *file)
|
||||
|
||||
/* Debugging loops structure at tree level. */
|
||||
|
||||
void
|
||||
void
|
||||
debug_loop_ir (void)
|
||||
{
|
||||
print_loop_ir (stderr);
|
||||
@ -5433,8 +5431,8 @@ tree_execute_on_shrinking_pred (edge e)
|
||||
of 'first'. Both of them are dominated by 'new_head' basic block. When
|
||||
'new_head' was created by 'second's incoming edge it received phi arguments
|
||||
on the edge by split_edge(). Later, additional edge 'e' was created to
|
||||
connect 'new_head' and 'first'. Now this routine adds phi args on this
|
||||
additional edge 'e' that new_head to second edge received as part of edge
|
||||
connect 'new_head' and 'first'. Now this routine adds phi args on this
|
||||
additional edge 'e' that new_head to second edge received as part of edge
|
||||
splitting.
|
||||
*/
|
||||
|
||||
@ -5452,8 +5450,8 @@ tree_lv_adjust_loop_header_phi (basic_block first, basic_block second,
|
||||
/* Browse all 'second' basic block phi nodes and add phi args to
|
||||
edge 'e' for 'first' head. PHI args are always in correct order. */
|
||||
|
||||
for (phi2 = phi_nodes (second), phi1 = phi_nodes (first);
|
||||
phi2 && phi1;
|
||||
for (phi2 = phi_nodes (second), phi1 = phi_nodes (first);
|
||||
phi2 && phi1;
|
||||
phi2 = PHI_CHAIN (phi2), phi1 = PHI_CHAIN (phi1))
|
||||
{
|
||||
tree def = PHI_ARG_DEF (phi2, e2->dest_idx);
|
||||
@ -5461,8 +5459,8 @@ tree_lv_adjust_loop_header_phi (basic_block first, basic_block second,
|
||||
}
|
||||
}
|
||||
|
||||
/* Adds a if else statement to COND_BB with condition COND_EXPR.
|
||||
SECOND_HEAD is the destination of the THEN and FIRST_HEAD is
|
||||
/* Adds a if else statement to COND_BB with condition COND_EXPR.
|
||||
SECOND_HEAD is the destination of the THEN and FIRST_HEAD is
|
||||
the destination of the ELSE part. */
|
||||
static void
|
||||
tree_lv_add_condition_to_bb (basic_block first_head, basic_block second_head,
|
||||
@ -5480,8 +5478,8 @@ tree_lv_add_condition_to_bb (basic_block first_head, basic_block second_head,
|
||||
goto2 = build1 (GOTO_EXPR, void_type_node, tree_block_label (second_head));
|
||||
new_cond_expr = build3 (COND_EXPR, void_type_node, cond_expr, goto1, goto2);
|
||||
|
||||
/* Add new cond in cond_bb. */
|
||||
bsi = bsi_start (cond_bb);
|
||||
/* Add new cond in cond_bb. */
|
||||
bsi = bsi_start (cond_bb);
|
||||
bsi_insert_after (&bsi, new_cond_expr, BSI_NEW_STMT);
|
||||
/* Adjust edges appropriately to connect new head with first head
|
||||
as well as second head. */
|
||||
@ -5518,7 +5516,7 @@ struct cfg_hooks tree_cfg_hooks = {
|
||||
tree_lv_add_condition_to_bb, /* lv_add_condition_to_bb */
|
||||
tree_lv_adjust_loop_header_phi, /* lv_adjust_loop_header_phi*/
|
||||
extract_true_false_edges_from_block, /* extract_cond_bb_edges */
|
||||
flush_pending_stmts /* flush_pending_stmts */
|
||||
flush_pending_stmts /* flush_pending_stmts */
|
||||
};
|
||||
|
||||
|
||||
@ -5547,7 +5545,7 @@ split_critical_edges (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct tree_opt_pass pass_split_crit_edges =
|
||||
struct tree_opt_pass pass_split_crit_edges =
|
||||
{
|
||||
"crited", /* name */
|
||||
NULL, /* gate */
|
||||
|
Loading…
x
Reference in New Issue
Block a user