From ca6c03cabd8de0c3d6614ffd3100eb063778871b Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 25 Sep 2001 17:26:55 +0200 Subject: Makefile.in (cfgrtl.o): Add. * Makefile.in (cfgrtl.o): Add. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. From-SVN: r45807 --- gcc/profile.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'gcc/profile.c') diff --git a/gcc/profile.c b/gcc/profile.c index 644a9b4..44cd15d 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -217,18 +217,15 @@ compute_branch_probabilities () int hist_br_prob[20]; int num_never_executed; int num_branches; - struct bb_info *bb_infos; /* Attach extra info block to each bb. */ - bb_infos = (struct bb_info *) - xcalloc (n_basic_blocks + 2, sizeof (struct bb_info)); + alloc_aux_for_blocks (sizeof (struct bb_info)); for (i = 0; i < n_basic_blocks + 2; i++) { basic_block bb = GCOV_INDEX_TO_BB (i); edge e; - bb->aux = &bb_infos[i]; for (e = bb->succ; e; e = e->succ_next) if (!EDGE_INFO (e)->ignore) BB_INFO (bb)->succ_count++; @@ -496,7 +493,7 @@ compute_branch_probabilities () fputc ('\n', rtl_dump_file); } - free (bb_infos); + free_aux_for_blocks (); } /* Instrument and/or analyze program behavior based on program flow graph. @@ -520,7 +517,6 @@ branch_prob () { int i; int num_edges, ignored_edges; - struct edge_info *edge_infos; struct edge_list *el; /* Start of a function. */ @@ -612,15 +608,13 @@ branch_prob () el = create_edge_list (); num_edges = NUM_EDGES (el); - edge_infos = (struct edge_info *) - xcalloc (num_edges, sizeof (struct edge_info)); + alloc_aux_for_edges (sizeof (struct edge_info)); ignored_edges = 0; for (i = 0 ; i < num_edges ; i++) { edge e = INDEX_EDGE (el, i); e->count = 0; - e->aux = &edge_infos[i]; /* Mark edges we've replaced by fake edges above as ignored. */ if ((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL)) @@ -803,7 +797,7 @@ branch_prob () if (rtl_dump_file) dump_flow_info (rtl_dump_file); - free (edge_infos); + free_aux_for_edges (); free_edge_list (el); } @@ -904,6 +898,11 @@ find_spanning_tree (el) union_groups (e->src, e->dest); } } + + EXIT_BLOCK_PTR->aux = NULL; + ENTRY_BLOCK_PTR->aux = NULL; + for (i = 0; i < n_basic_blocks; i++) + BASIC_BLOCK (i)->aux = NULL; } /* Perform file-level initialization for branch-prob processing. */ -- cgit v1.1