From: Martin Liska Date: Thu, 2 Aug 2018 10:17:34 +0000 (+0200) Subject: Fix gcov misleading error (PR gcov-profile/86817). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca498a11887e4d6b6a635db3e7df8b93804a4478;p=gcc.git Fix gcov misleading error (PR gcov-profile/86817). 2018-08-02 Martin Liska PR gcov-profile/86817 * gcov.c (process_all_functions): New function. (main): Call it. (process_file): Move functions processing to process_all_functions. From-SVN: r263248 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35e4d99751d..d0eaa6ef28c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-08-02 Martin Liska + + PR gcov-profile/86817 + * gcov.c (process_all_functions): New function. + (main): Call it. + (process_file): Move functions processing to + process_all_functions. + 2018-08-02 Thomas Preud'homme PR target/85434 diff --git a/gcc/gcov.c b/gcc/gcov.c index 78a3e0e19e9..43dfc9a4b2c 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -543,6 +543,7 @@ static int process_args (int, char **); static void print_usage (int) ATTRIBUTE_NORETURN; static void print_version (void) ATTRIBUTE_NORETURN; static void process_file (const char *); +static void process_all_functions (void); static void generate_results (const char *); static void create_file_names (const char *); static char *canonicalize_name (const char *); @@ -798,6 +799,7 @@ main (int argc, char **argv) if (flag_intermediate_format || argno == argc - 1) { + process_all_functions (); generate_results (argv[argno]); release_structures (); } @@ -1145,11 +1147,14 @@ process_file (const char *file_name) { create_file_names (file_name); read_graph_file (); - if (functions.empty ()) - return; - read_count_file (); +} +/* Process all functions in all files. */ + +static void +process_all_functions (void) +{ hash_map fn_map; /* Identify group functions. */ @@ -1226,7 +1231,6 @@ process_file (const char *file_name) if (fn->is_group) fn->lines.resize (fn->end_line - fn->start_line + 1); - solve_flow_graph (fn); if (fn->has_catch) find_exception_blocks (fn);