diff options
Diffstat (limited to 'gcc/libgcov.c')
-rw-r--r-- | gcc/libgcov.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/gcc/libgcov.c b/gcc/libgcov.c index 826617f..140ab05 100644 --- a/gcc/libgcov.c +++ b/gcc/libgcov.c @@ -94,13 +94,16 @@ static gcov_unsigned_t gcov_crc32; static int gcov_version (struct gcov_info *ptr, gcov_unsigned_t version) { - gcov_unsigned_t expected = GCOV_VERSION; - if (version != GCOV_VERSION) { + char v[4], e[4]; + + GCOV_UNSIGNED2STRING (v, version); + GCOV_UNSIGNED2STRING (e, GCOV_VERSION); + fprintf (stderr, "profiling:%s:Version mismatch - expected %.4s got %.4s\n", - ptr->filename, (const char *)&expected, (const char *)&version); + ptr->filename, e, v); return 0; } return 1; @@ -478,10 +481,12 @@ __gcov_merge_add (gcov_type *counters, unsigned n_counters) #endif /* L_gcov_merge_add */ #ifdef L_gcov_merge_single -/* The profile merging function for choosing the most common value. It is given - an array COUNTERS of N_COUNTERS old counters and it reads the same number - of counters from the gcov file. The counters are split into 3-tuples - where the members of the tuple have meanings: +/* The profile merging function for choosing the most common value. + It is given an array COUNTERS of N_COUNTERS old counters and it + reads the same number of counters from the gcov file. The counters + are split into 3-tuples where the members of the tuple have + meanings: + -- the stored candidate on the most common value of the measured entity -- counter -- total number of evaluations of the value */ @@ -491,9 +496,7 @@ __gcov_merge_single (gcov_type *counters, unsigned n_counters) unsigned i, n_measures; gcov_type value, counter, all; - if (n_counters % 3) - abort (); - + GCOV_CHECK (!(n_counters % 3)); n_measures = n_counters / 3; for (i = 0; i < n_measures; i++, counters += 3) { @@ -516,11 +519,12 @@ __gcov_merge_single (gcov_type *counters, unsigned n_counters) #endif /* L_gcov_merge_single */ #ifdef L_gcov_merge_delta -/* The profile merging function for choosing the most common difference between - two consecutive evaluations of the value. It is given an array COUNTERS of - N_COUNTERS old counters and it reads the same number of counters from the - gcov file. The counters are split into 4-tuples where the members of the - tuple have meanings: +/* The profile merging function for choosing the most common + difference between two consecutive evaluations of the value. It is + given an array COUNTERS of N_COUNTERS old counters and it reads the + same number of counters from the gcov file. The counters are split + into 4-tuples where the members of the tuple have meanings: + -- the last value of the measured entity -- the stored candidate on the most common difference -- counter @@ -531,9 +535,7 @@ __gcov_merge_delta (gcov_type *counters, unsigned n_counters) unsigned i, n_measures; gcov_type last, value, counter, all; - if (n_counters % 4) - abort (); - + GCOV_CHECK (!(n_counters % 4)); n_measures = n_counters / 4; for (i = 0; i < n_measures; i++, counters += 4) { |