diff options
Diffstat (limited to 'gcc/profile.cc')
-rw-r--r-- | gcc/profile.cc | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/gcc/profile.cc b/gcc/profile.cc index acc0ae0..550c85b97 100644 --- a/gcc/profile.cc +++ b/gcc/profile.cc @@ -1340,6 +1340,19 @@ branch_prob (bool thunk) EDGE_INFO (e)->ignore = 1; ignored_edges++; } + /* Ignore edges after musttail calls. */ + if (e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun)) + { + gimple_stmt_iterator gsi = gsi_last_bb (e->src); + gimple *stmt = gsi_stmt (gsi); + if (stmt + && is_gimple_call (stmt) + && gimple_call_must_tail_p (as_a <const gcall *> (stmt))) + { + EDGE_INFO (e)->ignore = 1; + ignored_edges++; + } + } } /* Create spanning tree from basic block graph, mark each edge that is @@ -1545,7 +1558,7 @@ branch_prob (bool thunk) remove_fake_edges (); - if (condition_coverage_flag || profile_arc_flag) + if (condition_coverage_flag || path_coverage_flag || profile_arc_flag) gimple_init_gcov_profiler (); if (condition_coverage_flag) @@ -1597,6 +1610,18 @@ branch_prob (bool thunk) instrument_values (values); } + unsigned instrument_prime_paths (struct function*); + if (path_coverage_flag) + { + const unsigned npaths = instrument_prime_paths (cfun); + if (output_to_file) + { + gcov_position_t offset = gcov_write_tag (GCOV_TAG_PATHS); + gcov_write_unsigned (npaths); + gcov_write_length (offset); + } + } + free_aux_for_edges (); values.release (); @@ -1780,3 +1805,10 @@ end_branch_prob (void) total_num_conds); } } + +/* Return true if any cfg coverage/profiling is enabled; -fprofile-arcs + -fcondition-coverage -fpath-coverage. */ +bool coverage_instrumentation_p () +{ + return profile_arc_flag || condition_coverage_flag || path_coverage_flag; +} |