diff options
author | Martin Liska <mliska@suse.cz> | 2018-08-27 10:01:54 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-08-27 08:01:54 +0000 |
commit | 7a583153ec27b45bd0b87b7c4defbc0d63777cda (patch) | |
tree | eb8ea2a6e7c6a1768a6c2c5059216943a98ab09a /gcc/gcov.c | |
parent | 266c2b54881d4b1898f30da801ca00f5967a0ad1 (diff) | |
download | gcc-7a583153ec27b45bd0b87b7c4defbc0d63777cda.zip gcc-7a583153ec27b45bd0b87b7c4defbc0d63777cda.tar.gz gcc-7a583153ec27b45bd0b87b7c4defbc0d63777cda.tar.bz2 |
Do not read gcda files multiple times (PR gcov-profile/87069).
2018-08-27 Martin Liska <mliska@suse.cz>
PR gcov-profile/87069
* gcov.c (process_file): Record files already processed
and warn about a file being processed multiple times.
From-SVN: r263871
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r-- | gcc/gcov.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -408,6 +408,10 @@ static vector<source_info> sources; /* Mapping of file names to sources */ static vector<name_map> names; +/* Record all processed files in order to warn about + a file being read multiple times. */ +static vector<char *> processed_files; + /* This holds data summary information. */ static unsigned object_runs; @@ -1146,6 +1150,17 @@ static void process_file (const char *file_name) { create_file_names (file_name); + + for (unsigned i = 0; i < processed_files.size (); i++) + if (strcmp (da_file_name, processed_files[i]) == 0) + { + fnotice (stderr, "'%s' file is already processed\n", + file_name); + return; + } + + processed_files.push_back (xstrdup (da_file_name)); + read_graph_file (); read_count_file (); } |