GCC Middle and Back End API Reference
tree-cfg.c File Reference

Data Structures

struct  cfg_stats_d
struct  locus_discrim_map
struct  locus_discrim_hasher
struct  label_record
struct  move_stmt_d

Functions

static void make_blocks (gimple_seq)
static void factor_computed_gotos (void)
static void make_edges (void)
static void assign_discriminators (void)
static void make_cond_expr_edges (basic_block)
static void make_gimple_switch_edges (basic_block)
static void make_goto_expr_edges (basic_block)
static void make_gimple_asm_edges (basic_block)
static edge gimple_redirect_edge_and_branch (edge, basic_block)
static edge gimple_try_redirect_by_replacing_jump (edge, basic_block)
static unsigned int split_critical_edges (void)
static bool stmt_starts_bb_p (gimple, gimple)
static int gimple_verify_flow_info (void)
static void gimple_make_forwarder_block (edge)
static gimple first_non_label_stmt (basic_block)
static bool verify_gimple_transaction (gimple)
static void gimple_merge_blocks (basic_block, basic_block)
static bool gimple_can_merge_blocks_p (basic_block, basic_block)
static void remove_bb (basic_block)
static edge find_taken_edge_computed_goto (basic_block, tree)
static edge find_taken_edge_cond_expr (basic_block, tree)
static edge find_taken_edge_switch_expr (basic_block, tree)
static tree find_case_label_for_value (gimple, tree)
void init_empty_tree_cfg_for_function ()
void init_empty_tree_cfg ()
static void build_gimple_cfg ()
static unsigned int execute_build_cfg ()
gimple_opt_passmake_pass_build_cfg ()
static bool computed_goto_p ()
static void make_blocks ()
static basic_block create_bb ()
void fold_cond_expr_cond ()
static int next_discriminator_for_locus ()
static bool same_line_p ()
static void make_cond_expr_edges ()
static bool edge_to_cases_cleanup (const void *key, void **value, void *data)
void start_recording_case_labels ()
static bool recording_case_labels_p ()
void end_recording_case_labels ()
static tree get_cases_for_edge ()
static void make_gimple_switch_edges ()
basic_block label_to_block_fn ()
void make_abnormal_goto_edges ()
static void make_goto_expr_edges ()
static void make_gimple_asm_edges ()
static tree main_block_label ()
static void cleanup_dead_labels_eh ()
void cleanup_dead_labels ()
void group_case_labels_stmt ()
void group_case_labels ()
static bool gimple_can_merge_blocks_p ()
bool has_zero_uses_1 ()
bool single_imm_use_1 (const ssa_use_operand_t *head, use_operand_p *use_p, gimple *stmt)
void replace_uses_by ()
static void gimple_merge_blocks ()
basic_block single_noncomplex_succ ()
void notice_special_calls ()
void clear_special_calls ()
static void remove_phi_nodes_and_edges_for_unreachable_block ()
static void remove_bb ()
edge find_taken_edge ()
static edge find_taken_edge_computed_goto ()
static edge find_taken_edge_cond_expr ()
static edge find_taken_edge_switch_expr ()
static tree find_case_label_for_value ()
void gimple_debug_bb ()
basic_block gimple_debug_bb_n ()
void gimple_debug_cfg ()
void gimple_dump_cfg ()
void dump_cfg_stats ()
DEBUG_FUNCTION void debug_cfg_stats ()
static bool call_can_make_abnormal_goto ()
bool stmt_can_make_abnormal_goto ()
bool is_ctrl_stmt ()
bool is_ctrl_altering_stmt ()
bool simple_goto_p ()
static bool stmt_starts_bb_p ()
bool stmt_ends_bb_p ()
void delete_tree_cfg_annotations ()
gimple first_stmt ()
static gimple first_non_label_stmt ()
gimple last_stmt ()
gimple last_and_only_stmt ()
static void reinstall_phi_args ()
static basic_block split_edge_bb_loc ()
static basic_block gimple_split_edge ()
static tree verify_address ()
static tree verify_expr ()
static bool verify_types_in_gimple_min_lval ()
static bool verify_types_in_gimple_reference ()
static bool one_pointer_to_useless_type_conversion_p ()
static bool valid_fixed_convert_types_p ()
static bool verify_gimple_call ()
static bool verify_gimple_comparison ()
static bool verify_gimple_assign_unary ()
static bool verify_gimple_assign_binary ()
static bool verify_gimple_assign_ternary ()
static bool verify_gimple_assign_single ()
static bool verify_gimple_assign ()
static bool verify_gimple_return ()
static bool verify_gimple_goto ()
static bool verify_gimple_switch ()
static bool verify_gimple_debug ()
static bool verify_gimple_label ()
static bool verify_gimple_stmt ()
static bool verify_gimple_phi ()
static bool verify_gimple_in_seq_2 ()
static bool verify_gimple_transaction ()
DEBUG_FUNCTION void verify_gimple_in_seq ()
bool tree_node_can_be_shared ()
static tree verify_node_sharing_1 ()
static tree verify_node_sharing ()
static int verify_eh_throw_stmt_node ()
static bool verify_location ()
static tree verify_expr_no_block ()
static tree verify_expr_location_1 ()
static tree verify_expr_location ()
static void collect_subblocks ()
DEBUG_FUNCTION void verify_gimple_in_cfg ()
static void gimple_make_forwarder_block ()
tree gimple_block_label ()
static edge gimple_try_redirect_by_replacing_jump ()
static edge gimple_redirect_edge_and_branch ()
static bool gimple_can_remove_branch_p ()
static basic_block gimple_redirect_edge_and_branch_force ()
static basic_block gimple_split_block ()
static bool gimple_move_block_after ()
bool gimple_empty_block_p ()
static basic_block gimple_split_block_before_cond_jump ()
static bool gimple_can_duplicate_bb_p ()
static basic_block gimple_duplicate_bb ()
static void add_phi_args_after_copy_edge ()
void add_phi_args_after_copy_bb ()
void add_phi_args_after_copy (basic_block *region_copy, unsigned n_region, edge e_copy)
bool gimple_duplicate_sese_region (edge entry, edge exit, basic_block *region, unsigned n_region, basic_block *region_copy, bool update_dominance)
static bool bb_part_of_region_p ()
bool gimple_duplicate_sese_tail (edge entry, edge exit, basic_block *region, unsigned n_region, basic_block *region_copy)
void gather_blocks_in_sese_region (basic_block entry, basic_block exit, vec< basic_block > *bbs_p)
static void replace_by_duplicate_decl (tree *tp, struct pointer_map_t *vars_map, tree to_context)
static tree replace_ssa_name (tree name, struct pointer_map_t *vars_map, tree to_context)
static tree move_stmt_op ()
static int move_stmt_eh_region_nr ()
static tree move_stmt_eh_region_tree_nr ()
static tree move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, struct walk_stmt_info *wi)
static void move_block_to_fn (struct function *dest_cfun, basic_block bb, basic_block after, bool update_edge_count_p, struct move_stmt_d *d)
static eh_region find_outermost_region_in_block (struct function *src_cfun, basic_block bb, eh_region region)
static tree new_label_mapper ()
static void replace_block_vars_by_duplicates (tree block, struct pointer_map_t *vars_map, tree to_context)
static void fixup_loop_arrays_after_move (struct function *fn1, struct function *fn2, struct loop *loop)
basic_block move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, basic_block exit_bb, tree orig_block)
void dump_function_to_file ()
DEBUG_FUNCTION void debug_function ()
static void print_pred_bbs ()
static void print_succ_bbs ()
void print_loops_bb ()
static void print_loop_and_siblings (FILE *, struct loop *, int, int)
static void print_loop ()
void print_loops ()
DEBUG_FUNCTION void debug ()
DEBUG_FUNCTION void debug_verbose ()
DEBUG_FUNCTION void debug_loops ()
DEBUG_FUNCTION void debug_loop ()
DEBUG_FUNCTION void debug_loop_num ()
static bool gimple_block_ends_with_call_p ()
static bool gimple_block_ends_with_condjump_p ()
static bool need_fake_edge_p ()
static int gimple_flow_call_edges_add ()
void remove_edge_and_dominated_blocks ()
bool gimple_purge_dead_eh_edges ()
bool gimple_purge_all_dead_eh_edges ()
bool gimple_purge_dead_abnormal_call_edges ()
bool gimple_purge_all_dead_abnormal_call_edges ()
static void gimple_execute_on_growing_pred ()
static void gimple_execute_on_shrinking_pred ()
static void gimple_lv_adjust_loop_header_phi (basic_block first, basic_block second, basic_block new_head, edge e)
static void gimple_lv_add_condition_to_bb (basic_block first_head, basic_block second_head, basic_block cond_bb, void *cond_e)
static void gimple_account_profile_record (basic_block bb, int after_pass, struct profile_record *record)
gimple_opt_passmake_pass_split_crit_edges ()
tree gimplify_build3 (gimple_stmt_iterator *gsi, enum tree_code code, tree type, tree a, tree b, tree c)
tree gimplify_build2 (gimple_stmt_iterator *gsi, enum tree_code code, tree type, tree a, tree b)
tree gimplify_build1 (gimple_stmt_iterator *gsi, enum tree_code code, tree type, tree a)
static unsigned int execute_warn_function_return ()
void extract_true_false_edges_from_block (basic_block b, edge *true_edge, edge *false_edge)
gimple_opt_passmake_pass_warn_function_return ()
static unsigned int execute_warn_function_noreturn ()
static bool gate_warn_function_noreturn ()
gimple_opt_passmake_pass_warn_function_noreturn ()
static void do_warn_unused_result ()
static unsigned int run_warn_unused_result ()
static bool gate_warn_unused_result ()
gimple_opt_passmake_pass_warn_unused_result ()
void gt_ggc_mx (tree &)
void gt_ggc_mx (rtx &)
void gt_ggc_mx (basic_block &)
void gt_ggc_mx ()
void gt_pch_nx (tree &)
void gt_pch_nx (rtx &)
void gt_pch_nx (basic_block &)
void gt_pch_nx ()

Variables

static const int initial_cfg_capacity = 20
static struct pointer_map_tedge_to_cases
static bitmap touched_switch_bbs
static struct cfg_stats_d cfg_stats
static bool found_computed_goto
static hash_table
< locus_discrim_hasher
discriminator_per_locus
static struct label_recordlabel_for_bb
static bool eh_error_found
struct cfg_hooks gimple_cfg_hooks

Function Documentation

void add_phi_args_after_copy ( basic_block region_copy,
unsigned  n_region,
edge  e_copy 
)
Blocks in REGION_COPY array of length N_REGION were created by
   duplication of basic blocks.  Add phi node arguments for edges
   going from these blocks.  If E_COPY is not NULL, also add
   phi node arguments for its destination. 

References add_phi_args_after_copy_bb(), and add_phi_args_after_copy_edge().

Referenced by gimple_duplicate_sese_region(), gimple_duplicate_sese_tail(), ipa_uninstrument_transaction(), slpeel_tree_duplicate_loop_to_edge_cfg(), and tail_duplicate().

void add_phi_args_after_copy_bb ( )
Basic block BB_COPY was created by code duplication.  Add phi node
   arguments for edges going out of BB_COPY.  The blocks that were
   duplicated have BB_DUPLICATED set.   

References add_phi_args_after_copy_edge(), and basic_block_def::succs.

Referenced by add_phi_args_after_copy(), and copy_phi_node_args().

static void add_phi_args_after_copy_edge ( )
static
static void assign_discriminators ( )
static
static bool bb_part_of_region_p ( )
static
Checks if BB is part of the region defined by N_REGION BBS.   

Referenced by gimple_duplicate_sese_tail().

static bool call_can_make_abnormal_goto ( )
static
Return true if T, a GIMPLE_CALL, can make an abnormal transfer of control
   flow.  Transfers of control flow associated with EH are excluded.   

References function::calls_setjmp, cfun, gimple_call_flags(), gimple_has_side_effects(), and function::has_nonlocal_label.

Referenced by is_ctrl_altering_stmt(), and stmt_can_make_abnormal_goto().

void clear_special_calls ( void  )
Clear flags set by notice_special_calls.  Used by dead code removal
   to update the flags.   

References function::calls_alloca, function::calls_setjmp, and cfun.

Referenced by eliminate_unnecessary_stmts().

static void collect_subblocks ( )
static
Insert all subblocks of BLOCK into BLOCKS and recurse.   

References pointer_set_insert().

Referenced by verify_gimple_in_cfg().

static bool computed_goto_p ( )
static
static basic_block create_bb ( )
static
Create and return a new empty basic block after bb AFTER.   

References alloc_block(), basic_block_def::flags, basic_block_def::index, link_block(), set_bb_seq(), and vec_safe_grow_cleared().

DEBUG_FUNCTION void debug ( )
Dump a loop.   

References print_loop().

DEBUG_FUNCTION void debug_cfg_stats ( void  )
Dump CFG statistics on stderr.  Keep extern so that it's always
   linked in the final executable.   

References dump_cfg_stats().

DEBUG_FUNCTION void debug_function ( )
Dump FUNCTION_DECL FN to stderr using FLAGS (see TDF_* in tree.h)   

References dump_function_to_file().

DEBUG_FUNCTION void debug_loop ( )
Print on stderr the code of LOOP, at some VERBOSITY level.   

References print_loop().

Referenced by debug_loop_num().

DEBUG_FUNCTION void debug_loop_num ( )
Print on stderr the code of loop number NUM, at some VERBOSITY
   level.   

References cfun, debug_loop(), and get_loop().

DEBUG_FUNCTION void debug_loops ( )
Debugging loops structure at tree level, at some VERBOSITY level.   

References print_loops().

DEBUG_FUNCTION void debug_verbose ( )
Dump a loop verbosely.   

References print_loop().

void delete_tree_cfg_annotations ( void  )
Remove block annotations and other data structures.   

References vec_free().

Referenced by gimple_expand_cfg(), and release_function_body().

static void do_warn_unused_result ( )
static
Walk a gimplified function and warn for functions whose return value is
   ignored and attribute((warn_unused_result)) is set.  This is done before
   inlining, so we don't have to worry about that.   

References g, gimple_bind_body(), gimple_call_fndecl(), gimple_call_fntype(), gimple_call_internal_p(), gimple_call_lhs(), gimple_catch_handler(), gimple_eh_filter_failure(), gimple_location(), gimple_try_cleanup(), gimple_try_eval(), gsi_end_p(), gsi_next(), gsi_stmt(), lookup_attribute(), and warning_at().

Referenced by run_warn_unused_result().

void dump_cfg_stats ( )
static bool edge_to_cases_cleanup ( const void *  key,
void **  value,
void *  data 
)
static
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
   SWITCH_EXPRs and structure sharing rules, then free the hash table
   element.   

Referenced by end_recording_case_labels().

void end_recording_case_labels ( void  )
Stop recording information mapping edges to case labels and
   remove any information we have recorded.   

References edge_to_cases_cleanup(), group_case_labels_stmt(), last_stmt(), pointer_map_destroy(), and pointer_map_traverse().

Referenced by cleanup_tree_cfg_1(), and split_critical_edges().

static unsigned int execute_warn_function_noreturn ( )
static
Emit noreturn warnings.   

References current_function_decl, and warn_function_noreturn().

static unsigned int execute_warn_function_return ( )
static
void extract_true_false_edges_from_block ( basic_block  b,
edge true_edge,
edge false_edge 
)
Given a basic block B which ends with a conditional and has
   precisely two successors, determine which of the edges is taken if
   the conditional is true and which is taken if the conditional is
   false.  Set TRUE_EDGE and FALSE_EDGE appropriately.   

References edge_def::flags.

Referenced by abs_replacement(), associate_equivalences_with_edges(), canonicalize_loop_ivs(), check_forbidden_calls(), conditional_replacement(), create_parallel_loop(), dom_opt_leave_block(), dump_implicit_edges(), expand_gimple_cond(), extract_true_false_args_from_phi(), find_taken_edge_cond_expr(), gimple_verify_flow_info(), minmax_replacement(), predicate_bbs(), record_edge_info(), tree_unswitch_loop(), and value_replacement().

static void factor_computed_gotos ( )
static
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
   normal form.   

References computed_goto_p(), create_artificial_label(), create_empty_bb(), create_tmp_var(), gimple_build_goto(), gimple_build_label(), gimple_goto_dest(), gimple_goto_set_dest(), gsi_end_p(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), and last.

Referenced by build_gimple_cfg().

static tree find_case_label_for_value ( gimple  ,
tree   
)
static
static tree find_case_label_for_value ( )
static
Return the CASE_LABEL_EXPR that SWITCH_STMT will take for VAL.
   We can make optimal use here of the fact that the case labels are
   sorted: We can do a binary search for a case matching VAL.   

References gimple_switch_default_label(), gimple_switch_label(), gimple_switch_num_labels(), and tree_int_cst_compare().

static eh_region find_outermost_region_in_block ( struct function src_cfun,
basic_block  bb,
eh_region  region 
)
static
Examine the statements in BB (which is in SRC_CFUN); find and return
   the outermost EH region.  Use REGION as the incoming base EH region.   

References eh_region_outermost(), get_eh_region_from_lp_number_fn(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), lookup_stmt_eh_lp_fn(), and si.

Referenced by move_sese_region_to_fn().

edge find_taken_edge ( )
Given a basic block BB ending with COND_EXPR or SWITCH_EXPR, and a
   predicate VAL, return the edge that will be taken out of the block.
   If VAL does not match a unique edge, NULL is returned.   

References computed_goto_p(), find_taken_edge_computed_goto(), find_taken_edge_cond_expr(), find_taken_edge_switch_expr(), is_ctrl_stmt(), is_gimple_min_invariant(), and last_stmt().

Referenced by cleanup_control_expr_graph(), copy_prop_visit_cond_stmt(), optimize_stmt(), propagate_rhs_into_lhs(), thread_across_edge(), thread_around_empty_block(), visit_cond_stmt(), and vrp_visit_cond_stmt().

static edge find_taken_edge_computed_goto ( basic_block  ,
tree   
)
static

Referenced by find_taken_edge().

static edge find_taken_edge_computed_goto ( )
static
Given a constant value VAL and the entry block BB to a GOTO_EXPR
   statement, determine which of the outgoing edges will be taken out of the
   block.  Return NULL if either edge may be taken.   

References find_edge().

static edge find_taken_edge_cond_expr ( basic_block  ,
tree   
)
static

Referenced by find_taken_edge().

static edge find_taken_edge_cond_expr ( )
static
Given a constant value VAL and the entry block BB to a COND_EXPR
   statement, determine which of the two edges will be taken out of the
   block.  Return NULL if either edge may be taken.   

References extract_true_false_edges_from_block(), and integer_zerop().

static edge find_taken_edge_switch_expr ( basic_block  ,
tree   
)
static

Referenced by find_taken_edge().

static edge find_taken_edge_switch_expr ( )
static
Given an INTEGER_CST VAL and the entry block BB to a SWITCH_EXPR
   statement, determine which edge will be taken out of the block.  Return
   NULL if any edge may be taken.   

References find_case_label_for_value(), find_edge(), and last_stmt().

static gimple first_non_label_stmt ( basic_block  )
static

Referenced by assign_discriminators().

static gimple first_non_label_stmt ( )
static
Return the first non-label statement in basic block BB.   

References gsi_end_p(), gsi_next(), gsi_start_bb(), and gsi_stmt().

static void fixup_loop_arrays_after_move ( struct function fn1,
struct function fn2,
struct loop loop 
)
static
Fixup the loop arrays and numbers after moving LOOP and its subloops
   from FN1 to FN2.   

References get_loops(), loop::inner, loops_for_fn(), loop::next, loop::num, number_of_loops(), and vec_safe_push().

Referenced by move_sese_region_to_fn().

static bool gate_warn_function_noreturn ( )
static
static bool gate_warn_unused_result ( )
static
void gather_blocks_in_sese_region ( basic_block  entry,
basic_block  exit,
vec< basic_block > *  bbs_p 
)
Add all the blocks dominated by ENTRY to the array BBS_P.  Stop
   adding blocks when the dominator traversal reaches EXIT.  This
   function silently assumes that ENTRY strictly dominates EXIT.   

References CDI_DOMINATORS, first_dom_son(), gather_blocks_in_sese_region(), and next_dom_son().

Referenced by eliminate_local_variables(), gather_blocks_in_sese_region(), move_sese_region_to_fn(), and separate_decls_in_region().

static tree get_cases_for_edge ( )
static
If we are inside a {start,end}_recording_cases block, then return
   a chain of CASE_LABEL_EXPRs from T which reference E.

   Otherwise return NULL.   

References find_edge(), gimple_switch_label(), gimple_switch_num_labels(), pointer_map_contains(), pointer_map_insert(), recording_case_labels_p(), and edge_def::src.

Referenced by gimple_redirect_edge_and_branch().

static void gimple_account_profile_record ( basic_block  bb,
int  after_pass,
struct profile_record record 
)
static
Do book-keeping of basic block BB for the profile consistency checker.
   If AFTER_PASS is 0, do pre-pass accounting, or if AFTER_PASS is 1
   then do post-pass accounting.  Store the counting in RECORD.   

References basic_block_def::count, eni_size_weights, eni_time_weights, estimate_num_insns(), basic_block_def::frequency, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), PROFILE_GUESSED, PROFILE_READ, profile_record::size, and profile_record::time.

static bool gimple_block_ends_with_call_p ( )
static
Return true if BB ends with a call, possibly followed by some
   instructions that must stay with the call.  Return false,
   otherwise.   

References gsi_end_p(), gsi_last_nondebug_bb(), gsi_stmt(), and is_gimple_call().

static bool gimple_block_ends_with_condjump_p ( )
static
Return true if BB ends with a conditional branch.  Return false,
   otherwise.   

References last_stmt().

static bool gimple_can_duplicate_bb_p ( )
static
Return true if basic_block can be duplicated.   
static bool gimple_can_merge_blocks_p ( basic_block  ,
basic_block   
)
static
static bool gimple_can_remove_branch_p ( )
static
Returns true if it is possible to remove edge E by redirecting
   it to the destination of the other edge from E->src.   

References edge_def::flags.

void gimple_debug_bb ( )
Dump a basic block on stderr.   

References dump_bb().

Referenced by gimple_debug_bb_n().

basic_block gimple_debug_bb_n ( )
Dump basic block with index N on stderr.   

References gimple_debug_bb().

void gimple_debug_cfg ( )
Dump the CFG on stderr.

   FLAGS are the same used by the tree dumping functions
   (see TDF_* in dumpfile.h).   

References gimple_dump_cfg().

void gimple_dump_cfg ( )
Dump the program showing basic block boundaries on the given FILE.

   FLAGS are the same used by the tree dumping functions (see TDF_* in
   tree.h).   

References brief_dump_cfg(), current_function_decl, dump_cfg_stats(), dump_function_header(), and dump_function_to_file().

Referenced by compute_branch_probabilities(), execute_fixup_cfg(), gimple_debug_cfg(), rewrite_out_of_ssa(), and tree_estimate_probability_driver().

bool gimple_duplicate_sese_region ( edge  entry,
edge  exit,
basic_block region,
unsigned  n_region,
basic_block region_copy,
bool  update_dominance 
)
Duplicates a REGION (set of N_REGION basic blocks) with just a single
   important exit edge EXIT.  By important we mean that no SSA name defined
   inside region is live over the other exit edges of the region.  All entry
   edges to the region must go to ENTRY->dest.  The edge ENTRY is redirected
   to the duplicate of the region.  Dominance and loop information is
   updated if UPDATE_DOMINANCE is true, but not the SSA web.  If
   UPDATE_DOMINANCE is false then we assume that the caller will update the
   dominance information after calling this function.  The new basic
   blocks are stored to REGION_COPY in the same order as they had in REGION,
   provided that REGION_COPY is not NULL.
   The function returns false if it is unable to copy the region,
   true otherwise.   

References add_phi_args_after_copy(), can_copy_bbs_p(), CDI_DOMINATORS, copy_bbs(), edge_def::count, basic_block_def::count, edge_def::dest, dominated_by_p(), flush_pending_stmts(), free(), free_original_copy_tables(), basic_block_def::frequency, get_bb_copy(), get_bb_original(), get_dominated_by_region(), loop::header, initialize_original_copy_tables(), iterate_fix_dominators(), loop::latch, basic_block_def::loop_father, loop_outer(), redirect_edge_and_branch(), scale_bbs_frequencies_gcov_type(), scale_bbs_frequencies_int(), set_immediate_dominator(), set_loop_copy(), split_edge_bb_loc(), and edge_def::src.

Referenced by copy_loop_headers().

bool gimple_duplicate_sese_tail ( edge  entry,
edge  exit,
basic_block region,
unsigned  n_region,
basic_block region_copy 
)
Duplicates REGION consisting of N_REGION blocks.  The new blocks
   are stored to REGION_COPY in the same order in that they appear
   in REGION, if REGION_COPY is not NULL.  ENTRY is the entry to
   the region, EXIT an exit from it.  The condition guarding EXIT
   is moved to ENTRY.  Returns true if duplication succeeds, false
   otherwise.

   For example,

   some_code;
   if (cond)
     A;
   else
     B;

   is transformed to

   if (cond)
     {
       some_code;
       A;
     }
   else
     {
       some_code;
       B;
     }

References add_phi_arg(), add_phi_args_after_copy(), bb_part_of_region_p(), can_copy_bbs_p(), CDI_DOMINATORS, cfun, copy_bbs(), duplicate_loop(), duplicate_subloops(), loop::exits, edge_def::flags, free(), free_original_copy_tables(), get_bb_copy(), get_bb_original(), get_dominated_by_region(), gimple_copy(), gimple_phi_arg_location_from_edge(), gsi_end_p(), gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_start_phis(), gsi_stmt(), loop::header, initialize_original_copy_tables(), loop::inner, iterate_fix_dominators(), last_stmt(), loop::latch, make_edge(), need_ssa_update_p(), loop::next, redirect_edge_and_branch(), rescan_loop_exit(), scale_bbs_frequencies_gcov_type(), scale_bbs_frequencies_int(), set_immediate_dominator(), set_loop_copy(), single_succ_edge(), split_edge(), split_edge_bb_loc(), stmt_ends_bb_p(), and update_ssa().

Referenced by transform_to_exit_first_loop().

bool gimple_empty_block_p ( )
Return TRUE if block BB has no executable statements, otherwise return
   FALSE.   

References walk_stmt_info::gsi, gsi_after_labels(), gsi_end_p(), gsi_next_nondebug(), gsi_stmt(), is_gimple_debug(), and phi_nodes().

static void gimple_execute_on_growing_pred ( )
static
This function is called whenever a new edge is created or
   redirected.   

References edge_def::dest, gimple_seq_empty_p(), phi_nodes(), and reserve_phi_args_for_new_edge().

static void gimple_execute_on_shrinking_pred ( )
static
This function is called immediately before edge E is removed from
   the edge vector E->dest->preds.   

References edge_def::dest, gimple_seq_empty_p(), phi_nodes(), and remove_phi_args().

static int gimple_flow_call_edges_add ( )
static
Add fake edges to the function exit for any non constant and non
   noreturn calls (or noreturn calls with EH/abnormal edges),
   volatile inline assembly in the bitmap of blocks specified by BLOCKS
   or to the whole CFG if BLOCKS is zero.  Return the number of blocks
   that were split.

   The goal is to expose cases in which entering a basic block does
   not imply that all subsequent instructions must be executed.   

References bitmap_bit_p(), find_edge(), gimple_build_nop(), gsi_commit_edge_inserts(), gsi_end_p(), gsi_insert_on_edge(), gsi_last_nondebug_bb(), gsi_prev(), gsi_stmt(), last_bb, last_stmt(), make_edge(), need_fake_edge_p(), basic_block_def::prev_bb, split_block(), and verify_flow_info().

static void gimple_lv_add_condition_to_bb ( basic_block  first_head,
basic_block  second_head,
basic_block  cond_bb,
void *  cond_e 
)
static
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.   

References edge_def::flags, gimple_build_cond_from_tree(), gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, and single_succ_edge().

static void gimple_lv_adjust_loop_header_phi ( basic_block  first,
basic_block  second,
basic_block  new_head,
edge  e 
)
static
Adjust phi nodes for 'first' basic block.  'second' basic block is a copy
   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
   splitting.   

References add_phi_arg(), edge_def::dest_idx, find_edge(), gimple_phi_arg_location_from_edge(), gsi_end_p(), gsi_next(), gsi_start_phis(), and gsi_stmt().

static void gimple_make_forwarder_block ( edge  )
static
static void gimple_make_forwarder_block ( )
static
static void gimple_merge_blocks ( basic_block  ,
basic_block   
)
static
Flowgraph optimization and cleanup.   
static bool gimple_move_block_after ( )
static
Moves basic block BB after block AFTER.   

References link_block(), basic_block_def::prev_bb, and unlink_block().

bool gimple_purge_all_dead_abnormal_call_edges ( )
Purge dead abnormal call edges from basic block listed in BLOCKS.   

References changed, and gimple_purge_dead_abnormal_call_edges().

Referenced by fini_eliminate().

bool gimple_purge_all_dead_eh_edges ( )
Purge dead EH edges from basic block listed in BLOCKS.   

References changed, and gimple_purge_dead_eh_edges().

Referenced by eliminate_degenerate_phis(), fini_eliminate(), tree_ssa_dominator_optimize(), and tree_ssa_dse().

static edge gimple_redirect_edge_and_branch ( edge  ,
basic_block   
)
static
static basic_block gimple_redirect_edge_and_branch_force ( )
static
Simple wrapper, as we can always redirect fallthru edges.   

References gimple_redirect_edge_and_branch().

static basic_block gimple_split_block ( )
static
Splits basic block BB after statement STMT (but at least after the
   labels).  If STMT is NULL, BB is split just after the labels.   

References create_empty_bb(), gimple_set_bb(), walk_stmt_info::gsi, gsi_end_p(), gsi_next(), gsi_split_seq_before(), gsi_start_bb(), gsi_stmt(), set_bb_seq(), edge_def::src, and basic_block_def::succs.

static basic_block gimple_split_block_before_cond_jump ( )
static
Split a basic block if it ends with a conditional branch and if the
   other part of the block is not empty.   

References edge_def::dest, walk_stmt_info::gsi, gsi_end_p(), gsi_last_nondebug_bb(), gsi_prev_nondebug(), gsi_stmt(), last, and split_block().

static basic_block gimple_split_edge ( )
static
static edge gimple_try_redirect_by_replacing_jump ( edge  ,
basic_block   
)
static
static edge gimple_try_redirect_by_replacing_jump ( )
static
Attempt to perform edge redirection by replacing a possibly complex
   jump instruction by a goto or by removing the jump completely.
   This can apply only if all edges now point to the same block.  The
   parameters and return values are equivalent to
   redirect_edge_and_branch.   

References edge_def::flags, gsi_end_p(), gsi_last_bb(), gsi_remove(), gsi_stmt(), edge_def::src, ssa_redirect_edge(), and basic_block_def::succs.

tree gimplify_build1 ( gimple_stmt_iterator gsi,
enum tree_code  code,
tree  type,
tree  a 
)
tree gimplify_build2 ( gimple_stmt_iterator gsi,
enum tree_code  code,
tree  type,
tree  a,
tree  b 
)
tree gimplify_build3 ( gimple_stmt_iterator gsi,
enum tree_code  code,
tree  type,
tree  a,
tree  b,
tree  c 
)
Build a ternary operation and gimplify it.  Emit code before GSI.
   Return the gimple_val holding the result.   

References force_gimple_operand_gsi(), gimple_location(), GSI_SAME_STMT, and gsi_stmt().

Referenced by do_compare(), expand_vector_condition(), and tree_vec_extract().

void group_case_labels ( void  )
Look for blocks ending in a multiway branch (a GIMPLE_SWITCH),
   and scan the sorted vector of cases.  Combine the ones jumping to the
   same label.   

References group_case_labels_stmt(), and last_stmt().

Referenced by build_gimple_cfg(), and execute_cleanup_cfg_post_optimizing().

void group_case_labels_stmt ( )
Scan the sorted vector of cases in STMT (a GIMPLE_SWITCH) and combine
   the ones jumping to the same label.
   Eg. three separate entries 1: 2: 3: become one entry 1..3:   

References gimple_switch_default_label(), gimple_switch_label(), gimple_switch_num_labels(), gimple_switch_set_label(), gimple_switch_set_num_labels(), and tree_to_double_int().

Referenced by end_recording_case_labels(), group_case_labels(), and process_switch().

void gt_ggc_mx ( tree )
Garbage collection support for edge_def.   
void gt_ggc_mx ( rtx )
void gt_ggc_mx ( basic_block )
void gt_pch_nx ( tree )
PCH support for edge_def.   
void gt_pch_nx ( rtx )
void gt_pch_nx ( basic_block )
bool has_zero_uses_1 ( )
Return true if the var whose chain of uses starts at PTR has no
   nondebug uses.   

References is_gimple_debug(), and ssa_use_operand_d::next.

Referenced by has_zero_uses().

void init_empty_tree_cfg_for_function ( )
bool is_ctrl_altering_stmt ( )
basic_block label_to_block_fn ( )
Return the basic block holding label DEST.   

References gimple_build_label(), gsi_insert_before(), GSI_NEW_STMT, gsi_start_bb(), seen_error(), and vec_safe_length().

gimple last_and_only_stmt ( )
Return the last statement of an otherwise empty block.  Return NULL
   if the block is totally empty, or if it contains more than one
   statement.   

References gsi_end_p(), gsi_last_nondebug_bb(), gsi_prev_nondebug(), gsi_stmt(), and last.

Referenced by abs_replacement(), cond_if_else_store_replacement(), cond_store_replacement(), determine_parallel_type(), do_while_loop_p(), and minmax_replacement().

gimple last_stmt ( )
Return the last statement in basic block BB.   

References gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_stmt(), and is_gimple_debug().

Referenced by abs_replacement(), apply_return_prediction(), assign_discriminators(), bound_difference(), canonicalize_loop_induction_variables(), canonicalize_loop_ivs(), cleanup_dead_labels(), cleanup_empty_eh(), collect_condition_stmts(), compute_complex_ancestor_jump_func(), cond_arg_set_in_bb(), conditional_replacement(), create_canonical_iv(), create_parallel_loop(), determine_parallel_type(), do_switchconv(), do_warn_aggressive_loop_optimizations(), do_while_loop_p(), dom_opt_leave_block(), dump_implicit_edges(), end_recording_case_labels(), estimate_numbers_of_iterations_loop(), execute_fixup_cfg(), execute_lower_eh_dispatch(), execute_lower_resx(), execute_warn_function_return(), expand_omp(), expand_omp_atomic(), expand_omp_atomic_fetch_op(), expand_omp_for(), expand_omp_for_static_chunk(), expand_omp_sections(), expand_omp_simd(), expand_omp_taskreg(), find_assert_locations_1(), find_taken_edge(), find_taken_edge_switch_expr(), fold_cond_expr_cond(), gen_parallel_loop(), get_loop_exit_condition(), gimple_block_ends_with_condjump_p(), gimple_can_merge_blocks_p(), gimple_duplicate_sese_tail(), gimple_flow_call_edges_add(), gimple_merge_blocks(), gimple_purge_dead_abnormal_call_edges(), gimple_purge_dead_eh_edges(), group_case_labels(), ifcombine_ifandif(), ignore_bb_p(), ip_normal_pos(), ipa_analyze_indirect_call_uses(), loop_niter_by_eval(), make_cond_expr_edges(), make_edges(), make_gimple_asm_edges(), make_gimple_switch_edges(), mark_last_stmt_necessary(), may_eliminate_iv(), maybe_optimize_range_tests(), minmax_replacement(), no_side_effect_bb(), number_of_iterations_exit(), optimize_range_tests(), phi_result_unknown_predicate(), predict_extra_loop_exits(), predict_iv_comparison(), predict_loops(), reassociate_bb(), redirect_eh_edge_1(), remove_exit_barrier(), set_cond_stmt_execution_predicate(), set_ifsese_condition(), set_switch_stmt_execution_predicate(), should_duplicate_loop_header_p(), simplify_using_entry_checks(), simplify_using_initial_conditions(), single_pred_cond_non_loop_exit(), split_function(), standard_iv_increment_position(), stmt_after_ip_normal_pos(), suitable_cond_bb(), tm_region_init(), transform_to_exit_first_loop(), tree_estimate_loop_size(), tree_estimate_probability_bb(), tree_may_unswitch_on(), tree_optimize_tail_calls_1(), tree_predict_by_opcode(), tree_ssa_ifcombine(), tree_ssa_iv_optimize_loop(), tree_ssa_phiopt_worker(), tree_unswitch_single_loop(), try_unroll_loop_completely(), update_range_test(), value_replacement(), vect_recog_bool_pattern(), vect_recog_divmod_pattern(), vect_recog_dot_prod_pattern(), vect_recog_mixed_size_cond_pattern(), vect_recog_pow_pattern(), vect_recog_rotate_pattern(), vect_recog_vector_vector_shift_pattern(), vect_recog_widen_mult_pattern(), vect_recog_widen_shift_pattern(), vect_recog_widen_sum_pattern(), and workshare_safe_to_combine_p().

static tree main_block_label ( )
static
Given LABEL return the first label in the same basic block.   

References basic_block_def::index, label_record::label, label_for_bb, and label_record::used.

Referenced by cleanup_dead_labels(), and cleanup_dead_labels_eh().

void make_abnormal_goto_edges ( )
Create edges for an abnormal goto statement at block BB.  If FOR_CALL
   is true, the source statement is a CALL_EXPR instead of a GOTO_EXPR.   

References gimple_call_flags(), gimple_label_label(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_call(), make_edge(), and target_bb.

Referenced by copy_edges_for_bb(), make_edges(), and make_goto_expr_edges().

static void make_blocks ( gimple_seq  )
static
Basic blocks and flowgraphs.   

Referenced by build_gimple_cfg().

static void make_cond_expr_edges ( basic_block  )
static

Referenced by make_edges().

static void make_cond_expr_edges ( )
static
static void make_gimple_asm_edges ( basic_block  )
static

Referenced by make_edges().

static void make_gimple_asm_edges ( )
static
Create edges for an asm statement with labels at block BB.   

References gimple_asm_label_op(), gimple_asm_nlabels(), last_stmt(), and make_edge().

static void make_gimple_switch_edges ( basic_block  )
static

Referenced by make_edges().

static void make_gimple_switch_edges ( )
static
Create the edges for a GIMPLE_SWITCH starting at block BB.   

References gimple_switch_label(), gimple_switch_num_labels(), last_stmt(), and make_edge().

static void make_goto_expr_edges ( basic_block  )
static

Referenced by make_edges().

static void make_goto_expr_edges ( )
static
gimple_opt_pass* make_pass_build_cfg ( )
gimple_opt_pass* make_pass_split_crit_edges ( )
gimple_opt_pass* make_pass_warn_function_noreturn ( )
gimple_opt_pass* make_pass_warn_function_return ( )
gimple_opt_pass* make_pass_warn_unused_result ( )
static void move_block_to_fn ( struct function dest_cfun,
basic_block  bb,
basic_block  after,
bool  update_edge_count_p,
struct move_stmt_d d 
)
static
Move basic block BB from function CFUN to function DEST_FN.  The
   block is moved out of the original linked list and placed after
   block AFTER in the new list.  Also, the block is removed from the
   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.

   The local variables are remapped to new instances, VARS_MAP is used
   to record the mapping.   

References loop::aux, CDI_DOMINATORS, function::cfg, cfun, delete_from_dominance_info(), move_stmt_d::eh_map, free_stmt_operands(), gimple_duplicate_stmt_histograms(), gimple_label_label(), gimple_phi_arg_location(), gimple_phi_arg_set_location(), gimple_remove_stmt_histograms(), edge_def::goto_locus, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), basic_block_def::index, walk_stmt_info::info, line_table, basic_block_def::loop_father, maybe_duplicate_eh_stmt_fn(), memset(), move_block_after(), move_stmt_op(), move_stmt_r(), move_stmt_d::new_block, move_stmt_d::orig_block, pop_cfun(), basic_block_def::preds, push_cfun(), remove_phi_node(), remove_stmt_from_eh_lp_fn(), replace_ssa_name(), si, basic_block_def::succs, update_stmt(), move_stmt_d::vars_map, vec_safe_grow_cleared(), vec_safe_length(), virtual_operand_p(), walk_gimple_stmt(), control_flow_graph::x_basic_block_info, control_flow_graph::x_label_to_block_map, control_flow_graph::x_last_basic_block, control_flow_graph::x_n_basic_blocks, and control_flow_graph::x_n_edges.

Referenced by move_sese_region_to_fn().

basic_block move_sese_region_to_fn ( struct function dest_cfun,
basic_block  entry_bb,
basic_block  exit_bb,
tree  orig_block 
)
Move a single-entry, single-exit region delimited by ENTRY_BB and
   EXIT_BB to function DEST_CFUN.  The whole region is replaced by a
   single basic block in the original CFG and the new basic block is
   returned.  DEST_CFUN must not have a CFG yet.

   Note that the region need not be a pure SESE region.  Blocks inside
   the region may contain calls to abort/exit.  The only restriction
   is that ENTRY_BB should be the only entry point and it must
   dominate EXIT_BB.

   Change TREE_BLOCK of all statements in ORIG_BLOCK to the new
   functions outermost BLOCK, move all subblocks of ORIG_BLOCK
   to the new function.

   All local variables referenced in the region are assumed to be in
   the corresponding BLOCK_VARS and unexpanded variable lists
   associated with DEST_CFUN.   

References add_bb_to_loop(), loop::aux, CDI_DOMINATORS, cfun, create_empty_bb(), function::decl, edge_def::dest, dominated_by_p(), duplicate_eh_regions(), function::eh, move_stmt_d::eh_map, ei_safe_edge(), loop::exits, find_outermost_region_in_block(), fixup_loop_arrays_after_move(), edge_def::flags, flow_loop_tree_node_add(), flow_loop_tree_node_remove(), free(), move_stmt_d::from_context, gather_blocks_in_sese_region(), get_dominated_by_region(), get_immediate_dominator(), get_loop(), loop::header, init_eh_for_function(), init_empty_tree_cfg(), init_loops_structure(), basic_block_def::loop_father, loop_outer(), loops_for_fn(), LOOPS_MAY_HAVE_MULTIPLE_LATCHES, make_edge(), memset(), move_block_to_fn(), move_stmt_d::new_block, move_stmt_d::new_label_map, new_label_mapper(), loop::num_nodes, move_stmt_d::orig_block, pointer_map_create(), pointer_map_destroy(), pop_cfun(), basic_block_def::preds, edge_def::probability, push_cfun(), move_stmt_d::remap_decls_p, remove_edge(), replace_block_vars_by_duplicates(), set_immediate_dominator(), set_loops_for_fn(), edge_def::src, loops::state, basic_block_def::succs, move_stmt_d::to_context, tree_map_hash(), and move_stmt_d::vars_map.

Referenced by expand_omp_taskreg().

static int move_stmt_eh_region_nr ( )
static
Helper for move_stmt_r.  Given an EH region number for the source
   function, map that to the duplicate EH regio number in the dest.   

References move_stmt_d::eh_map, get_eh_region_from_number(), eh_region_d::index, and pointer_map_contains().

Referenced by move_stmt_eh_region_tree_nr(), and move_stmt_r().

static tree move_stmt_eh_region_tree_nr ( )
static
Similar, but operate on INTEGER_CSTs.   

References build_int_cst(), move_stmt_eh_region_nr(), and tree_low_cst().

Referenced by move_stmt_r().

static tree move_stmt_op ( )
static
Helper for move_block_to_fn.  Set TREE_BLOCK in every expression
   contained in *TP if it has been ORIG_BLOCK previously and change the
   DECL_CONTEXT of every local variable referenced in *TP.   

References tree_map::base, tree_map_base::from, walk_stmt_info::info, is_global_var(), move_stmt_d::new_block, move_stmt_d::new_label_map, move_stmt_d::orig_block, move_stmt_d::remap_decls_p, replace_by_duplicate_decl(), replace_ssa_name(), tree_map::to, move_stmt_d::to_context, and move_stmt_d::vars_map.

Referenced by move_block_to_fn(), and move_stmt_r().

static tree move_stmt_r ( gimple_stmt_iterator gsi_p,
bool *  handled_ops_p,
struct walk_stmt_info wi 
)
static
Like move_stmt_op, but for gimple statements.

   Helper for move_block_to_fn.  Set GIMPLE_BLOCK in every expression
   contained in the current statement in *GSI_P and change the
   DECL_CONTEXT of every local variable referenced in the current
   statement.   

References BUILT_IN_NORMAL, gimple_block(), gimple_call_arg(), gimple_call_fndecl(), gimple_call_set_arg(), gimple_eh_dispatch_region(), gimple_eh_dispatch_set_region(), gimple_omp_body_ptr(), gimple_resx_region(), gimple_resx_set_region(), gimple_set_block(), gsi_stmt(), walk_stmt_info::info, is_gimple_omp(), move_stmt_eh_region_nr(), move_stmt_eh_region_tree_nr(), move_stmt_op(), move_stmt_d::new_block, move_stmt_d::orig_block, move_stmt_d::remap_decls_p, and walk_gimple_seq_mod().

Referenced by move_block_to_fn().

static bool need_fake_edge_p ( )
static
Return true if we need to add fake edge to exit at statement T.
   Helper function for gimple_flow_call_edges_add.   

References BUILT_IN_NORMAL, edge_def::flags, gimple_asm_input_p(), gimple_asm_volatile_p(), gimple_bb(), gimple_call_flags(), gimple_call_fndecl(), is_gimple_call(), and basic_block_def::succs.

Referenced by gimple_flow_call_edges_add().

static int next_discriminator_for_locus ( )
static
Find the next available discriminator value for LOCUS.  The
   discriminator distinguishes among several basic blocks that
   share a common locus, allowing for more accurate sample-based
   profiling.   

References locus_discrim_map::discriminator, hash_table< Descriptor, Allocator >::find_slot_with_hash(), and locus_discrim_map::locus.

Referenced by assign_discriminators().

void notice_special_calls ( )
T is CALL_EXPR.  Set current_function_calls_* flags.   

References function::calls_alloca, function::calls_setjmp, cfun, and gimple_call_flags().

Referenced by eliminate_unnecessary_stmts(), gimplify_call_expr(), and gimplify_modify_expr().

static bool one_pointer_to_useless_type_conversion_p ( )
static
Returns true if there is one pointer type in TYPE_POINTER_TO (SRC_OBJ)
   list of pointer-to types that is trivially convertible to DEST.   

References edge_def::src, and useless_type_conversion_p().

Referenced by verify_gimple_assign_single().

static void print_loop ( )
static
static void print_loop_and_siblings ( FILE *  file,
struct loop loop,
int  indent,
int  verbosity 
)
static
Print the LOOP and its sibling loops on FILE, indented INDENT
   spaces.  Following VERBOSITY level this outputs the contents of the
   loop, or just its structure.   

References loop::next, and print_loop().

Referenced by print_loop(), and print_loops().

void print_loops ( )
Follow a CFG edge from the entry point of the program, and on entry
   of a loop, pretty print the loop structure on FILE.   

References basic_block_def::loop_father, and print_loop_and_siblings().

Referenced by debug_loops(), and graphite_finalize().

void print_loops_bb ( )
Print to FILE the basic block BB following the VERBOSITY level.   

References dump_bb(), indent, basic_block_def::index, memset(), print_pred_bbs(), and print_succ_bbs().

Referenced by print_loop().

static void print_pred_bbs ( )
static
Print on FILE the indexes for the predecessors of basic_block BB.   

References basic_block_def::index, basic_block_def::preds, and edge_def::src.

Referenced by print_loops_bb().

static void print_succ_bbs ( )
static
Print on FILE the indexes for the successors of basic_block BB.   

References edge_def::dest, basic_block_def::index, and basic_block_def::succs.

Referenced by print_loops_bb().

static bool recording_case_labels_p ( )
static
Return nonzero if we are recording information for case labels.   

Referenced by get_cases_for_edge().

static void remove_bb ( basic_block  )
static
static void remove_phi_nodes_and_edges_for_unreachable_block ( )
static
Remove PHI nodes associated with basic block BB and all edges out of BB.   

References remove_edge(), remove_phi_nodes(), and basic_block_def::succs.

Referenced by remove_bb().

static void replace_block_vars_by_duplicates ( tree  block,
struct pointer_map_t vars_map,
tree  to_context 
)
static
Change DECL_CONTEXT of all BLOCK_VARS in block, including
   subblocks.   

References replace_by_duplicate_decl().

Referenced by move_sese_region_to_fn().

static void replace_by_duplicate_decl ( tree tp,
struct pointer_map_t vars_map,
tree  to_context 
)
static
Replaces *TP with a duplicate (belonging to function TO_CONTEXT).
   The duplicates are recorded in VARS_MAP.   

References add_local_decl(), copy_node(), copy_var_decl(), pointer_map_contains(), and pointer_map_insert().

Referenced by move_stmt_op(), replace_block_vars_by_duplicates(), and replace_ssa_name().

static tree replace_ssa_name ( tree  name,
struct pointer_map_t vars_map,
tree  to_context 
)
static
Creates an ssa name in TO_CONTEXT equivalent to NAME.
   VARS_MAP maps old ssa names and var_decls to the new ones.   

References copy_ssa_name_fn(), make_ssa_name_fn(), pointer_map_contains(), pointer_map_insert(), replace_by_duplicate_decl(), set_ssa_default_def(), and virtual_operand_p().

Referenced by move_block_to_fn(), and move_stmt_op().

static unsigned int run_warn_unused_result ( )
static
static bool same_line_p ( )
static
Return TRUE if LOCUS1 and LOCUS2 refer to the same source line.   

References expand_location().

Referenced by assign_discriminators().

bool simple_goto_p ( )
Return true if T is a simple local goto.   

References gimple_goto_dest().

Referenced by gimple_verify_flow_info(), make_goto_expr_edges(), and mark_stmt_if_obviously_necessary().

bool single_imm_use_1 ( const ssa_use_operand_t head,
use_operand_p use_p,
gimple stmt 
)
Return true if the var whose chain of uses starts at PTR has a
   single nondebug use.  Set USE_P and STMT to that single nondebug
   use, if so, or to NULL otherwise.   

References is_gimple_debug(), ssa_use_operand_d::loc, ssa_use_operand_d::next, and ssa_use_operand_d::stmt.

Referenced by has_single_use(), and single_imm_use().

basic_block single_noncomplex_succ ( )
Return the one of two successors of BB that is not reachable 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.   

References edge_def::dest, edge_def::flags, and basic_block_def::succs.

Referenced by compute_merit().

static basic_block split_edge_bb_loc ( )
static
Returns the basic block after which the new basic block created
   by splitting edge EDGE_IN should be placed.  Tries to keep the new block
   near its "logical" location.  This is of most help to humans looking
   at debugging dumps.   

References edge_def::dest, find_edge(), edge_def::flags, basic_block_def::prev_bb, and edge_def::src.

Referenced by gimple_duplicate_sese_region(), gimple_duplicate_sese_tail(), and gimple_split_edge().

void start_recording_case_labels ( void  )
Start recording information mapping edges to case labels.   

References pointer_map_create().

Referenced by cleanup_tree_cfg_1(), and split_critical_edges().

bool stmt_can_make_abnormal_goto ( )
Return true if T can make an abnormal transfer of control flow.
   Transfers of control flow associated with EH are excluded.   

References call_can_make_abnormal_goto(), computed_goto_p(), and is_gimple_call().

Referenced by copy_cfg_body(), copy_edges_for_bb(), eliminate_bb(), gimple_purge_dead_abnormal_call_edges(), make_blocks(), make_edges(), and maybe_move_debug_stmts_to_successors().

static bool stmt_starts_bb_p ( gimple  ,
gimple   
)
inlinestatic
Various helpers.   

Referenced by make_blocks().

static bool stmt_starts_bb_p ( )
inlinestatic
Return true if STMT should start a new basic block.  PREV_STMT is
   the statement preceding STMT.  It is used when STMT is a label or a
   case label.  Labels should only start a new basic block if their
   previous statement wasn't a label.  Otherwise, sequence of labels
   would generate unnecessary basic blocks that only contain a single
   label.   

References cfg_stats, gimple_call_flags(), gimple_label_label(), and cfg_stats_d::num_merged_labels.

bool tree_node_can_be_shared ( )
Return true when the T can be shared.   

References is_gimple_min_invariant().

Referenced by verify_node_sharing_1().

static bool valid_fixed_convert_types_p ( )
static
Return true if TYPE1 is a fixed-point type and if conversions to and
   from TYPE2 can be handled by FIXED_CONVERT_EXPR.   

Referenced by verify_gimple_assign_unary().

static tree verify_address ( )
static
Verify properties of the address expression T with base object BASE.   

References error(), and recompute_tree_invariant_for_addr_expr().

Referenced by verify_expr().

static int verify_eh_throw_stmt_node ( )
static
static tree verify_expr ( )
static
Callback for walk_tree, check that all elements with address taken are
   properly noticed as such.  The DATA is an int* that is 1 if TP was seen
   inside a PHI node.   

References error(), fold(), handled_component_p(), host_integerp(), is_gimple_address(), is_gimple_condexpr(), is_gimple_lvalue(), is_gimple_mem_ref_addr(), is_gimple_min_invariant(), is_gimple_reg_type(), ptrofftype_p(), and verify_address().

Referenced by verify_gimple_in_cfg().

static tree verify_expr_location ( )
static
Called via walk_gimple_op.  Verify locations of expressions.   

References walk_stmt_info::info, and verify_expr_location_1().

Referenced by verify_gimple_in_cfg().

static tree verify_expr_location_1 ( )
static
Called via walk_tree.  Verify locations of expressions.   

References verify_expr_no_block(), and verify_location().

Referenced by verify_expr_location(), and verify_gimple_in_cfg().

static tree verify_expr_no_block ( )
static
Called via walk_tree.  Verify that expressions have no blocks.   

Referenced by verify_expr_location_1().

static bool verify_gimple_assign ( )
static
static bool verify_gimple_assign_binary ( )
static
static bool verify_gimple_assign_ternary ( )
static
static bool verify_gimple_assign_unary ( )
static
Verify a gimple assignment statement STMT with an unary rhs.
   Returns true if anything is wrong.   

References debug_generic_expr(), error(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_code(), is_gimple_reg(), is_gimple_val(), ptrofftype_p(), useless_type_conversion_p(), and valid_fixed_convert_types_p().

Referenced by verify_gimple_assign().

static bool verify_gimple_comparison ( )
static
Verifies the gimple comparison with the result type TYPE and
   the operands OP0 and OP1.   

References debug_generic_expr(), error(), is_gimple_val(), and useless_type_conversion_p().

Referenced by verify_gimple_assign_binary(), and verify_gimple_stmt().

static bool verify_gimple_debug ( )
static
Verify a gimple debug statement STMT.
   Returns true if anything is wrong.   

Referenced by verify_gimple_stmt().

static bool verify_gimple_goto ( )
static
Verify the contents of a GIMPLE_GOTO STMT.  Returns true when there
   is a problem, otherwise false.   

References edge_def::dest, error(), gimple_goto_dest(), and is_gimple_val().

Referenced by verify_gimple_stmt().

DEBUG_FUNCTION void verify_gimple_in_seq ( )
Verify the GIMPLE statements inside the statement list STMTS.   

References internal_error(), timevar_pop(), timevar_push(), and verify_gimple_in_seq_2().

Referenced by gimplify_body().

static bool verify_gimple_label ( )
static
Verify a gimple label statement STMT.
   Returns true if anything is wrong.   

References function::cfg, cfun, error(), get_eh_landing_pad_from_number(), gimple_label_label(), and eh_landing_pad_d::post_landing_pad.

Referenced by verify_gimple_stmt().

static bool verify_gimple_phi ( )
static
Verify the contents of a GIMPLE_PHI.  Returns true if there is a problem,
   and false otherwise.   

References cfun, debug_generic_expr(), debug_generic_stmt(), error(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), gimple_vop(), is_gimple_val(), useless_type_conversion_p(), and virtual_operand_p().

Referenced by verify_gimple_in_cfg().

static bool verify_gimple_return ( )
static
Verify the contents of a GIMPLE_RETURN STMT.  Returns true when there
   is a problem, otherwise false.   

References cfun, debug_generic_stmt(), function::decl, error(), gimple_return_retval(), is_gimple_val(), and useless_type_conversion_p().

Referenced by verify_gimple_stmt().

static bool verify_gimple_switch ( )
static
Verify the contents of a GIMPLE_SWITCH STMT.  Returns true when there
   is a problem, otherwise false.   

References debug_generic_expr(), debug_generic_stmt(), error(), gimple_switch_index(), gimple_switch_label(), gimple_switch_num_labels(), is_gimple_val(), and tree_int_cst_lt().

Referenced by verify_gimple_stmt().

static bool verify_gimple_transaction ( gimple  )
static
static bool verify_gimple_transaction ( )
static
Verify the contents of a GIMPLE_TRANSACTION.  Returns true if there
   is a problem, otherwise false.   

References gimple_transaction_body(), gimple_transaction_label(), and verify_gimple_in_seq_2().

static bool verify_location ( )
static
Verify if the location LOCs block is in BLOCKS.   

References error(), and pointer_set_contains().

Referenced by verify_expr_location_1(), and verify_gimple_in_cfg().

static tree verify_node_sharing ( )
static
Called via walk_gimple_stmt.  Verify tree sharing.   

References walk_stmt_info::info, and verify_node_sharing_1().

Referenced by verify_gimple_in_cfg().

static tree verify_node_sharing_1 ( )
static
Called via walk_tree.  Verify tree sharing.   

References pointer_set_insert(), tree_node_can_be_shared(), and visited.

Referenced by verify_gimple_in_cfg(), and verify_node_sharing().

static bool verify_types_in_gimple_min_lval ( )
static
Verify if EXPR is either a GIMPLE ID or a GIMPLE indirect reference.
   Returns true if there is an error, otherwise false.   

References debug_generic_stmt(), error(), is_gimple_id(), and is_gimple_val().

Referenced by verify_types_in_gimple_reference().

static bool verify_types_in_gimple_reference ( )
static
Verify if EXPR is a valid GIMPLE reference expression.  If
   REQUIRE_LVALUE is true verifies it is an lvalue.  Returns true
   if there is an error, otherwise false.   

References debug_generic_stmt(), error(), handled_component_p(), is_gimple_mem_ref_addr(), is_gimple_min_invariant(), is_gimple_val(), useless_type_conversion_p(), and verify_types_in_gimple_min_lval().

Referenced by verify_gimple_assign_single(), and verify_gimple_call().


Variable Documentation

struct cfg_stats_d cfg_stats
static
hash_table<locus_discrim_hasher> discriminator_per_locus
static
struct pointer_map_t* edge_to_cases
static
This hash table allows us to efficiently lookup all CASE_LABEL_EXPRs
   which use a particular edge.  The CASE_LABEL_EXPRs are chained together
   via their CASE_CHAIN field, which we clear after we're done with the
   hash table to prevent problems with duplication of GIMPLE_SWITCHes.

   Access to this list of CASE_LABEL_EXPRs allows us to efficiently
   update the case vector in response to edge redirections.

   Right now this table is set up and torn down at key points in the
   compilation process.  It would be nice if we could make the table
   more persistent.  The key is getting notification of changes to
   the CFG (particularly edge removal, creation and redirection).   
bool eh_error_found
static
bool found_computed_goto
static
Nonzero if we found a computed goto while building basic blocks.   

Referenced by build_gimple_cfg(), and make_blocks().

struct cfg_hooks gimple_cfg_hooks
Hooks containers.   

Referenced by current_ir_type(), and gimple_register_cfg_hooks().

const int initial_cfg_capacity = 20
static
@verbatim Control flow functions for trees.

Copyright (C) 2001-2013 Free Software Foundation, Inc. Contributed by Diego Novillo dnovi.nosp@m.llo@.nosp@m.redha.nosp@m.t.co.nosp@m.m

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.

This file contains functions for building the Control Flow Graph (CFG)
   for a function tree.   
Local declarations.   
Initial capacity for the basic block array.   

Referenced by init_empty_tree_cfg_for_function().

struct label_record * label_for_bb
static
bitmap touched_switch_bbs
static
If we record edge_to_cases, this bitmap will hold indexes
   of basic blocks that end in a GIMPLE_SWITCH which we touched
   due to edge manipulations.