Commit 6d70e6be by Nathan Sidwell Committed by Nathan Sidwell

coverage.h (coverage_counter_alloc): New function.

	* coverage.h (coverage_counter_alloc): New function.
	* function.h (struct function): Remove arc_profile flag.
	* coverage.c (fn_ident): Remove.
	(fn_b_ctrs, no_coverage): New.
	(get_coverage_counts): Use current_function_funcdef_no.
	(coverage_counter_alloc): New.
	(coverage_counter_ref): Adjust.
	(coverage_begin_output): Check no_coverage. Use
	current_function_funcdef_no.
	(coverage_end_function): Likewise.
	(create_coverage): Set no_coverage. Set DECL_UNINLINEABLE rather
	than clearing flag_inline_functions. Do not clear arc_profile
	flag.
	* function.c (prepare_function_start): Do not set arc_profile
	flag.
	* profile.c (instrument_edges): Return number of instrumented
	edges. Use a for loop.
	(branch_prob): Call coverage_counter_alloc. Make BB_TO_GCOV_INDEX
	local to here and simplify. Use profile_arc_flag not arc_profile
	flag.
	(find_spanning_tree): Reformat.
	* toplev.c (rest_of_compilation): Use profile_arc_flags and
	flag_test_coverage rather than arc_profile flag.

From-SVN: r66695
parent afb19ffb
2003-05-11 Nathan Sidwell <nathan@codesourcery.com>
* coverage.h (coverage_counter_alloc): New function.
* function.h (struct function): Remove arc_profile flag.
* coverage.c (fn_ident): Remove.
(fn_b_ctrs, no_coverage): New.
(get_coverage_counts): Use current_function_funcdef_no.
(coverage_counter_alloc): New.
(coverage_counter_ref): Adjust.
(coverage_begin_output): Check no_coverage. Use
current_function_funcdef_no.
(coverage_end_function): Likewise.
(create_coverage): Set no_coverage. Set DECL_UNINLINEABLE rather
than clearing flag_inline_functions. Do not clear arc_profile
flag.
* function.c (prepare_function_start): Do not set arc_profile
flag.
* profile.c (instrument_edges): Return number of instrumented
edges. Use a for loop.
(branch_prob): Call coverage_counter_alloc. Make BB_TO_GCOV_INDEX
local to here and simplify. Use profile_arc_flag not arc_profile
flag.
(find_spanning_tree): Reformat.
* toplev.c (rest_of_compilation): Use profile_arc_flags and
flag_test_coverage rather than arc_profile flag.
2003-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net> 2003-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
* doc/invoke.texi (Wctor-dtor-privacy): Update documentation. * doc/invoke.texi (Wctor-dtor-privacy): Update documentation.
......
...@@ -72,17 +72,18 @@ typedef struct counts_entry ...@@ -72,17 +72,18 @@ typedef struct counts_entry
} counts_entry_t; } counts_entry_t;
static unsigned fn_ident = 1;
static struct function_list *functions_head = 0; static struct function_list *functions_head = 0;
static struct function_list **functions_tail = &functions_head; static struct function_list **functions_tail = &functions_head;
static unsigned no_coverage = 0;
/* Cumulative counter information for whole program. */ /* Cumulative counter information for whole program. */
static unsigned prg_ctr_mask; /* Mask of counter types generated. */ static unsigned prg_ctr_mask; /* Mask of counter types generated. */
static unsigned prg_n_ctrs[GCOV_COUNTERS]; static unsigned prg_n_ctrs[GCOV_COUNTERS]; /* Total counters allocated. */
/* Counter information for current function. */ /* Counter information for current function. */
static unsigned fn_ctr_mask; static unsigned fn_ctr_mask; /* Mask of counters used. */
static unsigned fn_n_ctrs[GCOV_COUNTERS]; static unsigned fn_n_ctrs[GCOV_COUNTERS]; /* Counters allocated. */
static unsigned fn_b_ctrs[GCOV_COUNTERS]; /* Allocation base. */
/* Name of the output file for coverage output file. */ /* Name of the output file for coverage output file. */
static char *bbg_file_name; static char *bbg_file_name;
...@@ -313,7 +314,7 @@ get_coverage_counts (unsigned counter, unsigned expected, ...@@ -313,7 +314,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
return NULL; return NULL;
} }
elt.ident = fn_ident; elt.ident = current_function_funcdef_no + 1;
elt.ctr = counter; elt.ctr = counter;
entry = htab_find (counts_hash, &elt); entry = htab_find (counts_hash, &elt);
if (!entry) if (!entry)
...@@ -337,15 +338,18 @@ get_coverage_counts (unsigned counter, unsigned expected, ...@@ -337,15 +338,18 @@ get_coverage_counts (unsigned counter, unsigned expected,
return entry->counts; return entry->counts;
} }
/* Generate a MEM rtl to access COUNTER NO . */ /* Allocate NUM counters of type COUNTER. Returns non-zero if the
allocation succeeded. */
rtx int
coverage_counter_ref (unsigned counter, unsigned no) coverage_counter_alloc (unsigned counter, unsigned num)
{ {
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1); if (no_coverage)
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0); return 0;
rtx ref;
if (!num)
return 1;
if (!ctr_labels[counter]) if (!ctr_labels[counter])
{ {
/* Generate and save a copy of this so it can be shared. */ /* Generate and save a copy of this so it can be shared. */
...@@ -354,13 +358,24 @@ coverage_counter_ref (unsigned counter, unsigned no) ...@@ -354,13 +358,24 @@ coverage_counter_ref (unsigned counter, unsigned no)
ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", counter + 1); ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", counter + 1);
ctr_labels[counter] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); ctr_labels[counter] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
} }
if (no + 1 > fn_n_ctrs[counter]) fn_b_ctrs[counter] = fn_n_ctrs[counter];
{ fn_n_ctrs[counter] += num;
fn_n_ctrs[counter] = no + 1; fn_ctr_mask |= 1 << counter;
fn_ctr_mask |= 1 << counter; return 1;
} }
no += prg_n_ctrs[counter]; /* Generate a MEM rtl to access COUNTER NO. */
rtx
coverage_counter_ref (unsigned counter, unsigned no)
{
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
rtx ref;
if (no >= fn_n_ctrs[counter] - fn_b_ctrs[counter])
abort ();
no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
ref = plus_constant (ctr_labels[counter], gcov_size / BITS_PER_UNIT * no); ref = plus_constant (ctr_labels[counter], gcov_size / BITS_PER_UNIT * no);
ref = gen_rtx_MEM (mode, ref); ref = gen_rtx_MEM (mode, ref);
set_mem_alias_set (ref, new_alias_set ()); set_mem_alias_set (ref, new_alias_set ());
...@@ -415,6 +430,9 @@ compute_checksum () ...@@ -415,6 +430,9 @@ compute_checksum ()
int int
coverage_begin_output () coverage_begin_output ()
{ {
if (no_coverage)
return 0;
if (!bbg_function_announced) if (!bbg_function_announced)
{ {
const char *file = DECL_SOURCE_FILE (current_function_decl); const char *file = DECL_SOURCE_FILE (current_function_decl);
...@@ -435,7 +453,7 @@ coverage_begin_output () ...@@ -435,7 +453,7 @@ coverage_begin_output ()
/* Announce function */ /* Announce function */
offset = gcov_write_tag (GCOV_TAG_FUNCTION); offset = gcov_write_tag (GCOV_TAG_FUNCTION);
gcov_write_unsigned (fn_ident); gcov_write_unsigned (current_function_funcdef_no + 1);
gcov_write_unsigned (compute_checksum ()); gcov_write_unsigned (compute_checksum ());
gcov_write_string (IDENTIFIER_POINTER gcov_write_string (IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl))); (DECL_ASSEMBLER_NAME (current_function_decl)));
...@@ -472,20 +490,18 @@ coverage_end_function () ...@@ -472,20 +490,18 @@ coverage_end_function ()
functions_tail = &item->next; functions_tail = &item->next;
item->next = 0; item->next = 0;
/* It would be nice to use the unique source location. */ item->ident = current_function_funcdef_no + 1;
item->ident = fn_ident;
item->checksum = compute_checksum (); item->checksum = compute_checksum ();
for (i = 0; i != GCOV_COUNTERS; i++) for (i = 0; i != GCOV_COUNTERS; i++)
{ {
item->n_ctrs[i] = fn_n_ctrs[i]; item->n_ctrs[i] = fn_n_ctrs[i];
prg_n_ctrs[i] += fn_n_ctrs[i]; prg_n_ctrs[i] += fn_n_ctrs[i];
fn_n_ctrs[i] = 0; fn_n_ctrs[i] = fn_b_ctrs[i] = 0;
} }
prg_ctr_mask |= fn_ctr_mask; prg_ctr_mask |= fn_ctr_mask;
fn_ctr_mask = 0; fn_ctr_mask = 0;
} }
bbg_function_announced = 0; bbg_function_announced = 0;
fn_ident++;
} }
/* Creates the gcov_fn_info RECORD_TYPE. */ /* Creates the gcov_fn_info RECORD_TYPE. */
...@@ -799,8 +815,9 @@ create_coverage () ...@@ -799,8 +815,9 @@ create_coverage ()
char *ctor_name; char *ctor_name;
tree ctor; tree ctor;
rtx gcov_info_address; rtx gcov_info_address;
int save_flag_inline_functions = flag_inline_functions;
no_coverage = 1; /* Disable any further coverage. */
if (!prg_ctr_mask) if (!prg_ctr_mask)
return; return;
...@@ -830,6 +847,7 @@ create_coverage () ...@@ -830,6 +847,7 @@ create_coverage ()
TREE_PUBLIC (ctor) = ! targetm.have_ctors_dtors; TREE_PUBLIC (ctor) = ! targetm.have_ctors_dtors;
TREE_USED (ctor) = 1; TREE_USED (ctor) = 1;
DECL_RESULT (ctor) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); DECL_RESULT (ctor) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
DECL_UNINLINABLE (ctor) = 1;
ctor = (*lang_hooks.decls.pushdecl) (ctor); ctor = (*lang_hooks.decls.pushdecl) (ctor);
rest_of_decl_compilation (ctor, 0, 1, 0); rest_of_decl_compilation (ctor, 0, 1, 0);
...@@ -840,7 +858,6 @@ create_coverage () ...@@ -840,7 +858,6 @@ create_coverage ()
init_function_start (ctor, input_filename, input_line); init_function_start (ctor, input_filename, input_line);
(*lang_hooks.decls.pushlevel) (0); (*lang_hooks.decls.pushlevel) (0);
expand_function_start (ctor, 0); expand_function_start (ctor, 0);
cfun->arc_profile = 0;
/* Actually generate the code to call __gcov_init. */ /* Actually generate the code to call __gcov_init. */
gcov_info_address = force_reg (Pmode, XEXP (DECL_RTL (gcov_info), 0)); gcov_info_address = force_reg (Pmode, XEXP (DECL_RTL (gcov_info), 0));
...@@ -850,16 +867,8 @@ create_coverage () ...@@ -850,16 +867,8 @@ create_coverage ()
expand_function_end (input_filename, input_line, 0); expand_function_end (input_filename, input_line, 0);
(*lang_hooks.decls.poplevel) (1, 0, 1); (*lang_hooks.decls.poplevel) (1, 0, 1);
/* Since ctor isn't in the list of globals, it would never be emitted
when it's considered to be 'safe' for inlining, so turn off
flag_inline_functions. */
flag_inline_functions = 0;
rest_of_compilation (ctor); rest_of_compilation (ctor);
/* Reset flag_inline_functions to its original value. */
flag_inline_functions = save_flag_inline_functions;
if (! quiet_flag) if (! quiet_flag)
fflush (asm_out_file); fflush (asm_out_file);
current_function_decl = NULL_TREE; current_function_decl = NULL_TREE;
......
...@@ -25,10 +25,21 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -25,10 +25,21 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
extern void coverage_init (const char *); extern void coverage_init (const char *);
extern void coverage_finish (void); extern void coverage_finish (void);
/* Complete the coverage information for the current function. Once
per function. */
extern void coverage_end_function (void); extern void coverage_end_function (void);
/* Start outputting coverage information for the current
function. Repeatable per function. */
extern int coverage_begin_output (void); extern int coverage_begin_output (void);
/* Allocate some counters. Repeatable per function. */
extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/);
/* Use a counter from the most recent allocation. */
extern rtx coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/); extern rtx coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/);
/* Get all the counters for the current function. */
extern gcov_type *get_coverage_counts (unsigned /*counter*/, extern gcov_type *get_coverage_counts (unsigned /*counter*/,
unsigned /*expected*/, unsigned /*expected*/,
const struct gcov_ctr_summary **); const struct gcov_ctr_summary **);
......
...@@ -6434,8 +6434,6 @@ prepare_function_start () ...@@ -6434,8 +6434,6 @@ prepare_function_start ()
current_function_funcdef_no = funcdef_no++; current_function_funcdef_no = funcdef_no++;
cfun->arc_profile = profile_arc_flag || flag_test_coverage;
cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL; cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL;
cfun->max_jumptable_ents = 0; cfun->max_jumptable_ents = 0;
......
...@@ -452,9 +452,6 @@ struct function GTY(()) ...@@ -452,9 +452,6 @@ struct function GTY(())
generated. */ generated. */
unsigned int instrument_entry_exit : 1; unsigned int instrument_entry_exit : 1;
/* Nonzero if arc profiling should be done for the function. */
unsigned int arc_profile : 1;
/* Nonzero if profiling code should be generated. */ /* Nonzero if profiling code should be generated. */
unsigned int profile : 1; unsigned int profile : 1;
......
...@@ -84,12 +84,6 @@ struct bb_info { ...@@ -84,12 +84,6 @@ struct bb_info {
#define EDGE_INFO(e) ((struct edge_info *) (e)->aux) #define EDGE_INFO(e) ((struct edge_info *) (e)->aux)
#define BB_INFO(b) ((struct bb_info *) (b)->aux) #define BB_INFO(b) ((struct bb_info *) (b)->aux)
/* Keep all basic block indexes nonnegative in the gcov output. Index 0
is used for entry block, last block exit block. */
#define BB_TO_GCOV_INDEX(bb) ((bb) == ENTRY_BLOCK_PTR ? 0 \
: ((bb) == EXIT_BLOCK_PTR \
? last_basic_block + 1 : (bb)->index + 1))
/* Counter summary from the last set of coverage counts read. */ /* Counter summary from the last set of coverage counts read. */
const struct gcov_ctr_summary *profile_info; const struct gcov_ctr_summary *profile_info;
...@@ -111,7 +105,7 @@ static int total_num_branches; ...@@ -111,7 +105,7 @@ static int total_num_branches;
/* Forward declarations. */ /* Forward declarations. */
static void find_spanning_tree PARAMS ((struct edge_list *)); static void find_spanning_tree PARAMS ((struct edge_list *));
static rtx gen_edge_profiler PARAMS ((int)); static rtx gen_edge_profiler PARAMS ((int));
static void instrument_edges PARAMS ((struct edge_list *)); static unsigned instrument_edges PARAMS ((struct edge_list *));
static void compute_branch_probabilities PARAMS ((void)); static void compute_branch_probabilities PARAMS ((void));
static gcov_type * get_exec_counts PARAMS ((void)); static gcov_type * get_exec_counts PARAMS ((void));
static basic_block find_group PARAMS ((basic_block)); static basic_block find_group PARAMS ((basic_block));
...@@ -123,40 +117,45 @@ static void union_groups PARAMS ((basic_block, basic_block)); ...@@ -123,40 +117,45 @@ static void union_groups PARAMS ((basic_block, basic_block));
F is the first insn of the chain. F is the first insn of the chain.
NUM_BLOCKS is the number of basic blocks found in F. */ NUM_BLOCKS is the number of basic blocks found in F. */
static void static unsigned
instrument_edges (el) instrument_edges (el)
struct edge_list *el; struct edge_list *el;
{ {
int num_instr_edges = 0; unsigned num_instr_edges = 0;
int num_edges = NUM_EDGES (el); int num_edges = NUM_EDGES (el);
basic_block bb; basic_block bb;
remove_fake_edges (); remove_fake_edges ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
{ {
edge e = bb->succ; edge e;
while (e)
for (e = bb->succ; e; e = e->succ_next)
{ {
struct edge_info *inf = EDGE_INFO (e); struct edge_info *inf = EDGE_INFO (e);
if (!inf->ignore && !inf->on_tree) if (!inf->ignore && !inf->on_tree)
{ {
rtx edge_profile;
if (e->flags & EDGE_ABNORMAL) if (e->flags & EDGE_ABNORMAL)
abort (); abort ();
if (rtl_dump_file) if (rtl_dump_file)
fprintf (rtl_dump_file, "Edge %d to %d instrumented%s\n", fprintf (rtl_dump_file, "Edge %d to %d instrumented%s\n",
e->src->index, e->dest->index, e->src->index, e->dest->index,
EDGE_CRITICAL_P (e) ? " (and split)" : ""); EDGE_CRITICAL_P (e) ? " (and split)" : "");
insert_insn_on_edge ( edge_profile = gen_edge_profiler (num_instr_edges++);
gen_edge_profiler (num_instr_edges++), e); insert_insn_on_edge (edge_profile, e);
rebuild_jump_labels (e->insns); rebuild_jump_labels (e->insns);
} }
e = e->succ_next;
} }
} }
total_num_blocks_created += num_edges; total_num_blocks_created += num_edges;
if (rtl_dump_file) if (rtl_dump_file)
fprintf (rtl_dump_file, "%d edges instrumented\n", num_instr_edges); fprintf (rtl_dump_file, "%d edges instrumented\n", num_instr_edges);
return num_instr_edges;
} }
...@@ -353,9 +352,9 @@ compute_branch_probabilities () ...@@ -353,9 +352,9 @@ compute_branch_probabilities ()
for (e = bb->pred; e; e = e->pred_next) for (e = bb->pred; e; e = e->pred_next)
total += e->count; total += e->count;
/* Seedgeh for the invalid edge, and set its count. */ /* Search for the invalid edge, and set its count. */
for (e = bb->pred; e; e = e->pred_next) for (e = bb->pred; e; e = e->pred_next)
if (! EDGE_INFO (e)->count_valid && ! EDGE_INFO (e)->ignore) if (!EDGE_INFO (e)->count_valid && !EDGE_INFO (e)->ignore)
break; break;
/* Calculate count for remaining edge by conservation. */ /* Calculate count for remaining edge by conservation. */
...@@ -552,6 +551,7 @@ branch_prob () ...@@ -552,6 +551,7 @@ branch_prob ()
basic_block bb; basic_block bb;
unsigned i; unsigned i;
unsigned num_edges, ignored_edges; unsigned num_edges, ignored_edges;
unsigned num_instrumented;
struct edge_list *el; struct edge_list *el;
total_num_times_called++; total_num_times_called++;
...@@ -644,18 +644,23 @@ branch_prob () ...@@ -644,18 +644,23 @@ branch_prob ()
as possible to minimize number of edge splits necessary. */ as possible to minimize number of edge splits necessary. */
find_spanning_tree (el); find_spanning_tree (el);
/* Fake edges that are not on the tree will not be instrumented, so /* Fake edges that are not on the tree will not be instrumented, so
mark them ignored. */ mark them ignored. */
for (i = 0; i < num_edges; i++) for (num_instrumented = i = 0; i < num_edges; i++)
{ {
edge e = INDEX_EDGE (el, i); edge e = INDEX_EDGE (el, i);
struct edge_info *inf = EDGE_INFO (e); struct edge_info *inf = EDGE_INFO (e);
if ((e->flags & EDGE_FAKE) && !inf->ignore && !inf->on_tree)
if (inf->ignore || inf->on_tree)
/*NOP*/;
else if (e->flags & EDGE_FAKE)
{ {
inf->ignore = 1; inf->ignore = 1;
ignored_edges++; ignored_edges++;
} }
else
num_instrumented++;
} }
total_num_blocks += n_basic_blocks + 2; total_num_blocks += n_basic_blocks + 2;
...@@ -684,6 +689,13 @@ branch_prob () ...@@ -684,6 +689,13 @@ branch_prob ()
gcov_write_length (offset); gcov_write_length (offset);
} }
/* Keep all basic block indexes nonnegative in the gcov output.
Index 0 is used for entry block, last index is for exit block.
*/
ENTRY_BLOCK_PTR->index = -1;
EXIT_BLOCK_PTR->index = last_basic_block;
#define BB_TO_GCOV_INDEX(bb) ((bb)->index + 1)
/* Arcs */ /* Arcs */
if (coverage_begin_output ()) if (coverage_begin_output ())
{ {
...@@ -788,15 +800,21 @@ branch_prob () ...@@ -788,15 +800,21 @@ branch_prob ()
} }
} }
} }
ENTRY_BLOCK_PTR->index = ENTRY_BLOCK;
EXIT_BLOCK_PTR->index = EXIT_BLOCK;
#undef BB_TO_GCOV_INDEX
if (flag_branch_probabilities) if (flag_branch_probabilities)
compute_branch_probabilities (); compute_branch_probabilities ();
/* For each edge not on the spanning tree, add counting code as rtl. */ /* For each edge not on the spanning tree, add counting code as rtl. */
if (profile_arc_flag
if (cfun->arc_profile && profile_arc_flag) && coverage_counter_alloc (GCOV_COUNTER_ARCS, num_instrumented))
{ {
instrument_edges (el); unsigned n_instrumented = instrument_edges (el);
if (n_instrumented != num_instrumented)
abort ();
/* Commit changes done by instrumentation. */ /* Commit changes done by instrumentation. */
commit_edge_insertions_watch_calls (); commit_edge_insertions_watch_calls ();
...@@ -880,8 +898,7 @@ find_spanning_tree (el) ...@@ -880,8 +898,7 @@ find_spanning_tree (el)
{ {
edge e = INDEX_EDGE (el, i); edge e = INDEX_EDGE (el, i);
if (((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_FAKE)) if (((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_FAKE))
|| e->dest == EXIT_BLOCK_PTR || e->dest == EXIT_BLOCK_PTR)
)
&& !EDGE_INFO (e)->ignore && !EDGE_INFO (e)->ignore
&& (find_group (e->src) != find_group (e->dest))) && (find_group (e->src) != find_group (e->dest)))
{ {
...@@ -897,9 +914,8 @@ find_spanning_tree (el) ...@@ -897,9 +914,8 @@ find_spanning_tree (el)
for (i = 0; i < num_edges; i++) for (i = 0; i < num_edges; i++)
{ {
edge e = INDEX_EDGE (el, i); edge e = INDEX_EDGE (el, i);
if ((EDGE_CRITICAL_P (e)) if (EDGE_CRITICAL_P (e) && !EDGE_INFO (e)->ignore
&& !EDGE_INFO (e)->ignore && find_group (e->src) != find_group (e->dest))
&& (find_group (e->src) != find_group (e->dest)))
{ {
if (rtl_dump_file) if (rtl_dump_file)
fprintf (rtl_dump_file, "Critical edge %d to %d put to tree\n", fprintf (rtl_dump_file, "Critical edge %d to %d put to tree\n",
...@@ -913,8 +929,8 @@ find_spanning_tree (el) ...@@ -913,8 +929,8 @@ find_spanning_tree (el)
for (i = 0; i < num_edges; i++) for (i = 0; i < num_edges; i++)
{ {
edge e = INDEX_EDGE (el, i); edge e = INDEX_EDGE (el, i);
if (find_group (e->src) != find_group (e->dest) if (!EDGE_INFO (e)->ignore
&& !EDGE_INFO (e)->ignore) && find_group (e->src) != find_group (e->dest))
{ {
if (rtl_dump_file) if (rtl_dump_file)
fprintf (rtl_dump_file, "Normal edge %d to %d put to tree\n", fprintf (rtl_dump_file, "Normal edge %d to %d put to tree\n",
......
...@@ -3087,13 +3087,14 @@ rest_of_compilation (decl) ...@@ -3087,13 +3087,14 @@ rest_of_compilation (decl)
close_dump_file (DFI_cfg, print_rtl_with_bb, insns); close_dump_file (DFI_cfg, print_rtl_with_bb, insns);
/* Do branch profiling and static profile estimation passes. */ /* Do branch profiling and static profile estimation passes. */
if (optimize > 0 || cfun->arc_profile || flag_branch_probabilities) if (optimize > 0
|| profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
{ {
struct loops loops; struct loops loops;
timevar_push (TV_BRANCH_PROB); timevar_push (TV_BRANCH_PROB);
open_dump_file (DFI_bp, decl); open_dump_file (DFI_bp, decl);
if (cfun->arc_profile || flag_branch_probabilities) if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
branch_prob (); branch_prob ();
/* Discover and record the loop depth at the head of each basic /* Discover and record the loop depth at the head of each basic
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment