aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog32
-rw-r--r--gcc/auto-profile.c9
-rw-r--r--gcc/coverage.c49
-rw-r--r--gcc/coverage.h2
-rw-r--r--gcc/gcov-dump.c63
-rw-r--r--gcc/gcov-io.c148
-rw-r--r--gcc/gcov-io.h38
-rw-r--r--gcc/gcov.c2
-rw-r--r--gcc/lto-cgraph.c4
-rw-r--r--gcc/lto-streamer.h2
-rw-r--r--gcc/profile.c2
-rw-r--r--gcc/profile.h2
12 files changed, 171 insertions, 182 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 609f1c5..6e968d6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,37 @@
2018-06-05 Martin Liska <mliska@suse.cz>
+ * auto-profile.c (read_autofdo_file): Do not use
+ gcov_ctr_summary struct.
+ (afdo_callsite_hot_enough_for_early_inline): Likewise.
+ * coverage.c (struct counts_entry): Likewise.
+ (read_counts_file): Read just single summary entry.
+ (get_coverage_counts): Use gcov_summary struct.
+ * coverage.h (get_coverage_counts): Likewise.
+ * gcov-dump.c (dump_working_sets): Likewise.
+ (tag_summary): Dump just single summary.
+ * gcov-io.c (gcov_write_summary): Write just histogram
+ summary.
+ (gcov_read_summary): Read just single summary.
+ (compute_working_sets): Use gcov_summary struct.
+ * gcov-io.h (GCOV_TAG_SUMMARY_LENGTH): Remove usage
+ of GCOV_COUNTERS_SUMMABLE.
+ (GCOV_COUNTERS_SUMMABLE): Remove.
+ (GCOV_FIRST_VALUE_COUNTER): Replace with
+ GCOV_COUNTER_V_INTERVAL.
+ (struct gcov_ctr_summary): Remove.
+ (struct gcov_summary): Directly use fields of former
+ gcov_ctr_summary.
+ (compute_working_sets): Use gcov_summary struct.
+ * gcov.c (read_count_file): Do not use ctrs fields.
+ * lto-cgraph.c (merge_profile_summaries): Use gcov_summary
+ struct.
+ * lto-streamer.h (struct GTY): Make profile_info gcov_summary
+ struct.
+ * profile.c: Likewise.
+ * profile.h: Likewise.
+
+2018-06-05 Martin Liska <mliska@suse.cz>
+
PR gcov-profile/84846
* gcov.c (output_lines): Print working directory only
in intermediate format.
diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index e794496..197fa10 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -318,8 +318,8 @@ static string_table *afdo_string_table;
/* Store the AutoFDO source profile. */
static autofdo_source_profile *afdo_source_profile;
-/* gcov_ctr_summary structure to store the profile_info. */
-static struct gcov_ctr_summary *afdo_profile_info;
+/* gcov_summary structure to store the profile_info. */
+static gcov_summary *afdo_profile_info;
/* Helper functions. */
@@ -1682,8 +1682,7 @@ read_autofdo_file (void)
if (auto_profile_file == NULL)
auto_profile_file = DEFAULT_AUTO_PROFILE_FILE;
- autofdo::afdo_profile_info = (struct gcov_ctr_summary *)xcalloc (
- 1, sizeof (struct gcov_ctr_summary));
+ autofdo::afdo_profile_info = XNEW (gcov_summary);
autofdo::afdo_profile_info->runs = 1;
autofdo::afdo_profile_info->sum_max = 0;
autofdo::afdo_profile_info->sum_all = 0;
@@ -1713,7 +1712,7 @@ afdo_callsite_hot_enough_for_early_inline (struct cgraph_edge *edge)
if (count > 0)
{
bool is_hot;
- const struct gcov_ctr_summary *saved_profile_info = profile_info;
+ const gcov_summary *saved_profile_info = profile_info;
/* At early inline stage, profile_info is not set yet. We need to
temporarily set it to afdo_profile_info to calculate hotness. */
profile_info = autofdo::afdo_profile_info;
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 9e0185a..84fff13 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -73,7 +73,7 @@ struct counts_entry : pointer_hash <counts_entry>
unsigned lineno_checksum;
unsigned cfg_checksum;
gcov_type *counts;
- struct gcov_ctr_summary summary;
+ gcov_summary summary;
/* hash_table support. */
static inline hashval_t hash (const counts_entry *);
@@ -185,7 +185,7 @@ static void
read_counts_file (void)
{
gcov_unsigned_t fn_ident = 0;
- struct gcov_summary summary;
+ gcov_summary summary;
unsigned new_summary = 1;
gcov_unsigned_t tag;
int is_error = 0;
@@ -241,27 +241,21 @@ read_counts_file (void)
else if (tag == GCOV_TAG_PROGRAM_SUMMARY)
{
struct gcov_summary sum;
- unsigned ix;
if (new_summary)
memset (&summary, 0, sizeof (summary));
gcov_read_summary (&sum);
- for (ix = 0; ix != GCOV_COUNTERS_SUMMABLE; ix++)
- {
- summary.ctrs[ix].runs += sum.ctrs[ix].runs;
- summary.ctrs[ix].sum_all += sum.ctrs[ix].sum_all;
- if (summary.ctrs[ix].run_max < sum.ctrs[ix].run_max)
- summary.ctrs[ix].run_max = sum.ctrs[ix].run_max;
- summary.ctrs[ix].sum_max += sum.ctrs[ix].sum_max;
- }
+ summary.runs += sum.runs;
+ summary.sum_all += sum.sum_all;
+ if (summary.run_max < sum.run_max)
+ summary.run_max = sum.run_max;
+ summary.sum_max += sum.sum_max;
if (new_summary)
- memcpy (summary.ctrs[GCOV_COUNTER_ARCS].histogram,
- sum.ctrs[GCOV_COUNTER_ARCS].histogram,
- sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE);
+ memcpy (summary.histogram, sum.histogram,
+ sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE);
else
- gcov_histogram_merge (summary.ctrs[GCOV_COUNTER_ARCS].histogram,
- sum.ctrs[GCOV_COUNTER_ARCS].histogram);
+ gcov_histogram_merge (summary.histogram, sum.histogram);
new_summary = 0;
}
else if (GCOV_TAG_IS_COUNTER (tag) && fn_ident)
@@ -282,8 +276,8 @@ read_counts_file (void)
entry->ctr = elt.ctr;
entry->lineno_checksum = lineno_checksum;
entry->cfg_checksum = cfg_checksum;
- if (elt.ctr < GCOV_COUNTERS_SUMMABLE)
- entry->summary = summary.ctrs[elt.ctr];
+ if (elt.ctr == GCOV_COUNTER_ARCS)
+ entry->summary = summary;
entry->summary.num = n_counts;
entry->counts = XCNEWVEC (gcov_type, n_counts);
}
@@ -306,23 +300,16 @@ read_counts_file (void)
counts_hash = NULL;
break;
}
- else if (elt.ctr >= GCOV_COUNTERS_SUMMABLE)
- {
- error ("cannot merge separate %s counters for function %u",
- ctr_names[elt.ctr], fn_ident);
- goto skip_merge;
- }
else
{
- entry->summary.runs += summary.ctrs[elt.ctr].runs;
- entry->summary.sum_all += summary.ctrs[elt.ctr].sum_all;
- if (entry->summary.run_max < summary.ctrs[elt.ctr].run_max)
- entry->summary.run_max = summary.ctrs[elt.ctr].run_max;
- entry->summary.sum_max += summary.ctrs[elt.ctr].sum_max;
+ entry->summary.runs += summary.runs;
+ entry->summary.sum_all += summary.sum_all;
+ if (entry->summary.run_max < summary.run_max)
+ entry->summary.run_max = summary.run_max;
+ entry->summary.sum_max += summary.sum_max;
}
for (ix = 0; ix != n_counts; ix++)
entry->counts[ix] += gcov_read_counter ();
- skip_merge:;
}
gcov_sync (offset, length);
if ((is_error = gcov_is_error ()))
@@ -345,7 +332,7 @@ read_counts_file (void)
gcov_type *
get_coverage_counts (unsigned counter, unsigned expected,
unsigned cfg_checksum, unsigned lineno_checksum,
- const struct gcov_ctr_summary **summary)
+ const gcov_summary **summary)
{
counts_entry *entry, elt;
diff --git a/gcc/coverage.h b/gcc/coverage.h
index 689e39e..842d695 100644
--- a/gcc/coverage.h
+++ b/gcc/coverage.h
@@ -54,7 +54,7 @@ extern gcov_type *get_coverage_counts (unsigned /*counter*/,
unsigned /*expected*/,
unsigned /*cfg_checksum*/,
unsigned /*lineno_checksum*/,
- const struct gcov_ctr_summary **);
+ const gcov_summary **);
extern tree get_gcov_type (void);
extern bool coverage_node_map_initialized_p (void);
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c
index 0ae7e94..3ff11a6 100644
--- a/gcc/gcov-dump.c
+++ b/gcc/gcov-dump.c
@@ -39,7 +39,7 @@ static void tag_lines (const char *, unsigned, unsigned, unsigned);
static void tag_counters (const char *, unsigned, unsigned, unsigned);
static void tag_summary (const char *, unsigned, unsigned, unsigned);
static void dump_working_sets (const char *filename ATTRIBUTE_UNUSED,
- const struct gcov_ctr_summary *summary,
+ const gcov_summary *summary,
unsigned depth);
extern int main (int, char **);
@@ -467,52 +467,47 @@ tag_summary (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED,
unsigned depth)
{
- struct gcov_summary summary;
- unsigned ix, h_ix;
+ gcov_summary summary;
+ unsigned h_ix;
gcov_bucket_type *histo_bucket;
gcov_read_summary (&summary);
printf (" checksum=0x%08x", summary.checksum);
- for (ix = 0; ix != GCOV_COUNTERS_SUMMABLE; ix++)
+ printf ("\n");
+ print_prefix (filename, depth, 0);
+ printf (VALUE_PADDING_PREFIX "counts=%u, runs=%u",
+ summary.num, summary.runs);
+
+ printf (", sum_all=%" PRId64,
+ (int64_t)summary.sum_all);
+ printf (", run_max=%" PRId64,
+ (int64_t)summary.run_max);
+ printf (", sum_max=%" PRId64,
+ (int64_t)summary.sum_max);
+ printf ("\n");
+ print_prefix (filename, depth, 0);
+ printf (VALUE_PADDING_PREFIX "counter histogram:");
+ for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++)
{
+ histo_bucket = &summary.histogram[h_ix];
+ if (!histo_bucket->num_counters)
+ continue;
printf ("\n");
print_prefix (filename, depth, 0);
- printf (VALUE_PADDING_PREFIX "counts=%u, runs=%u",
- summary.ctrs[ix].num, summary.ctrs[ix].runs);
-
- printf (", sum_all=%" PRId64,
- (int64_t)summary.ctrs[ix].sum_all);
- printf (", run_max=%" PRId64,
- (int64_t)summary.ctrs[ix].run_max);
- printf (", sum_max=%" PRId64,
- (int64_t)summary.ctrs[ix].sum_max);
- if (ix != GCOV_COUNTER_ARCS)
- continue;
- printf ("\n");
- print_prefix (filename, depth, 0);
- printf (VALUE_PADDING_PREFIX "counter histogram:");
- for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++)
- {
- histo_bucket = &summary.ctrs[ix].histogram[h_ix];
- if (!histo_bucket->num_counters)
- continue;
- printf ("\n");
- print_prefix (filename, depth, 0);
- printf (VALUE_PADDING_PREFIX VALUE_PREFIX "num counts=%u, "
- "min counter=%" PRId64 ", cum_counter=%" PRId64,
- h_ix, histo_bucket->num_counters,
- (int64_t)histo_bucket->min_value,
- (int64_t)histo_bucket->cum_value);
- }
- if (flag_dump_working_sets)
- dump_working_sets (filename, &summary.ctrs[ix], depth);
+ printf (VALUE_PADDING_PREFIX VALUE_PREFIX "num counts=%u, "
+ "min counter=%" PRId64 ", cum_counter=%" PRId64,
+ h_ix, histo_bucket->num_counters,
+ (int64_t)histo_bucket->min_value,
+ (int64_t)histo_bucket->cum_value);
}
+ if (flag_dump_working_sets)
+ dump_working_sets (filename, &summary, depth);
}
static void
dump_working_sets (const char *filename ATTRIBUTE_UNUSED,
- const struct gcov_ctr_summary *summary,
+ const gcov_summary *summary,
unsigned depth)
{
gcov_working_set_t gcov_working_sets[NUM_GCOV_WORKING_SETS];
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 3fe1e61..e07ae76 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -446,8 +446,7 @@ gcov_write_tag_length (gcov_unsigned_t tag, gcov_unsigned_t length)
GCOV_LINKAGE void
gcov_write_summary (gcov_unsigned_t tag, const struct gcov_summary *summary)
{
- unsigned ix, h_ix, bv_ix, h_cnt = 0;
- const struct gcov_ctr_summary *csum;
+ unsigned h_ix, bv_ix, h_cnt = 0;
unsigned histo_bitvector[GCOV_HISTOGRAM_BITVECTOR_SIZE];
/* Count number of non-zero histogram entries, and fill in a bit vector
@@ -455,38 +454,29 @@ gcov_write_summary (gcov_unsigned_t tag, const struct gcov_summary *summary)
counters. */
for (bv_ix = 0; bv_ix < GCOV_HISTOGRAM_BITVECTOR_SIZE; bv_ix++)
histo_bitvector[bv_ix] = 0;
- csum = &summary->ctrs[GCOV_COUNTER_ARCS];
for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++)
- if (csum->histogram[h_ix].num_counters)
+ if (summary->histogram[h_ix].num_counters)
{
histo_bitvector[h_ix / 32] |= 1 << (h_ix % 32);
h_cnt++;
}
gcov_write_tag_length (tag, GCOV_TAG_SUMMARY_LENGTH (h_cnt));
gcov_write_unsigned (summary->checksum);
- for (csum = summary->ctrs, ix = GCOV_COUNTERS_SUMMABLE; ix--; csum++)
+
+ gcov_write_unsigned (summary->num);
+ gcov_write_unsigned (summary->runs);
+ gcov_write_counter (summary->sum_all);
+ gcov_write_counter (summary->run_max);
+ gcov_write_counter (summary->sum_max);
+ for (bv_ix = 0; bv_ix < GCOV_HISTOGRAM_BITVECTOR_SIZE; bv_ix++)
+ gcov_write_unsigned (histo_bitvector[bv_ix]);
+ for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++)
{
- gcov_write_unsigned (csum->num);
- gcov_write_unsigned (csum->runs);
- gcov_write_counter (csum->sum_all);
- gcov_write_counter (csum->run_max);
- gcov_write_counter (csum->sum_max);
- if (ix != GCOV_COUNTER_ARCS)
- {
- for (bv_ix = 0; bv_ix < GCOV_HISTOGRAM_BITVECTOR_SIZE; bv_ix++)
- gcov_write_unsigned (0);
- continue;
- }
- for (bv_ix = 0; bv_ix < GCOV_HISTOGRAM_BITVECTOR_SIZE; bv_ix++)
- gcov_write_unsigned (histo_bitvector[bv_ix]);
- for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++)
- {
- if (!csum->histogram[h_ix].num_counters)
- continue;
- gcov_write_unsigned (csum->histogram[h_ix].num_counters);
- gcov_write_counter (csum->histogram[h_ix].min_value);
- gcov_write_counter (csum->histogram[h_ix].cum_value);
- }
+ if (!summary->histogram[h_ix].num_counters)
+ continue;
+ gcov_write_unsigned (summary->histogram[h_ix].num_counters);
+ gcov_write_counter (summary->histogram[h_ix].min_value);
+ gcov_write_counter (summary->histogram[h_ix].cum_value);
}
}
#endif /* IN_LIBGCOV */
@@ -598,68 +588,64 @@ gcov_read_string (void)
GCOV_LINKAGE void
gcov_read_summary (struct gcov_summary *summary)
{
- unsigned ix, h_ix, bv_ix, h_cnt = 0;
- struct gcov_ctr_summary *csum;
+ unsigned h_ix, bv_ix, h_cnt = 0;
unsigned histo_bitvector[GCOV_HISTOGRAM_BITVECTOR_SIZE];
unsigned cur_bitvector;
summary->checksum = gcov_read_unsigned ();
- for (csum = summary->ctrs, ix = GCOV_COUNTERS_SUMMABLE; ix--; csum++)
+ summary->num = gcov_read_unsigned ();
+ summary->runs = gcov_read_unsigned ();
+ summary->sum_all = gcov_read_counter ();
+ summary->run_max = gcov_read_counter ();
+ summary->sum_max = gcov_read_counter ();
+ memset (summary->histogram, 0,
+ sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE);
+ for (bv_ix = 0; bv_ix < GCOV_HISTOGRAM_BITVECTOR_SIZE; bv_ix++)
{
- csum->num = gcov_read_unsigned ();
- csum->runs = gcov_read_unsigned ();
- csum->sum_all = gcov_read_counter ();
- csum->run_max = gcov_read_counter ();
- csum->sum_max = gcov_read_counter ();
- memset (csum->histogram, 0,
- sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE);
- for (bv_ix = 0; bv_ix < GCOV_HISTOGRAM_BITVECTOR_SIZE; bv_ix++)
- {
- histo_bitvector[bv_ix] = gcov_read_unsigned ();
+ histo_bitvector[bv_ix] = gcov_read_unsigned ();
#if IN_LIBGCOV
- /* When building libgcov we don't include system.h, which includes
- hwint.h (where popcount_hwi is declared). However, libgcov.a
- is built by the bootstrapped compiler and therefore the builtins
- are always available. */
- h_cnt += __builtin_popcount (histo_bitvector[bv_ix]);
+ /* When building libgcov we don't include system.h, which includes
+ hwint.h (where popcount_hwi is declared). However, libgcov.a
+ is built by the bootstrapped compiler and therefore the builtins
+ are always available. */
+ h_cnt += __builtin_popcount (histo_bitvector[bv_ix]);
#else
- h_cnt += popcount_hwi (histo_bitvector[bv_ix]);
+ h_cnt += popcount_hwi (histo_bitvector[bv_ix]);
#endif
- }
- bv_ix = 0;
- h_ix = 0;
- cur_bitvector = 0;
- while (h_cnt--)
- {
- /* Find the index corresponding to the next entry we will read in.
- First find the next non-zero bitvector and re-initialize
- the histogram index accordingly, then right shift and increment
- the index until we find a set bit. */
- while (!cur_bitvector)
- {
- h_ix = bv_ix * 32;
- if (bv_ix >= GCOV_HISTOGRAM_BITVECTOR_SIZE)
- gcov_error ("corrupted profile info: summary histogram "
- "bitvector is corrupt");
- cur_bitvector = histo_bitvector[bv_ix++];
- }
- while (!(cur_bitvector & 0x1))
- {
- h_ix++;
- cur_bitvector >>= 1;
- }
- if (h_ix >= GCOV_HISTOGRAM_SIZE)
- gcov_error ("corrupted profile info: summary histogram "
- "index is corrupt");
-
- csum->histogram[h_ix].num_counters = gcov_read_unsigned ();
- csum->histogram[h_ix].min_value = gcov_read_counter ();
- csum->histogram[h_ix].cum_value = gcov_read_counter ();
- /* Shift off the index we are done with and increment to the
- corresponding next histogram entry. */
- cur_bitvector >>= 1;
- h_ix++;
- }
+ }
+ bv_ix = 0;
+ h_ix = 0;
+ cur_bitvector = 0;
+ while (h_cnt--)
+ {
+ /* Find the index corresponding to the next entry we will read in.
+ First find the next non-zero bitvector and re-initialize
+ the histogram index accordingly, then right shift and increment
+ the index until we find a set bit. */
+ while (!cur_bitvector)
+ {
+ h_ix = bv_ix * 32;
+ if (bv_ix >= GCOV_HISTOGRAM_BITVECTOR_SIZE)
+ gcov_error ("corrupted profile info: summary histogram "
+ "bitvector is corrupt");
+ cur_bitvector = histo_bitvector[bv_ix++];
+ }
+ while (!(cur_bitvector & 0x1))
+ {
+ h_ix++;
+ cur_bitvector >>= 1;
+ }
+ if (h_ix >= GCOV_HISTOGRAM_SIZE)
+ gcov_error ("corrupted profile info: summary histogram "
+ "index is corrupt");
+
+ summary->histogram[h_ix].num_counters = gcov_read_unsigned ();
+ summary->histogram[h_ix].min_value = gcov_read_counter ();
+ summary->histogram[h_ix].cum_value = gcov_read_counter ();
+ /* Shift off the index we are done with and increment to the
+ corresponding next histogram entry. */
+ cur_bitvector >>= 1;
+ h_ix++;
}
}
@@ -921,7 +907,7 @@ static void gcov_histogram_merge (gcov_bucket_type *tgt_histo,
the minimum counter value in that working set. */
GCOV_LINKAGE void
-compute_working_sets (const struct gcov_ctr_summary *summary,
+compute_working_sets (const gcov_summary *summary,
gcov_working_set_t *gcov_working_sets)
{
gcov_type working_set_cum_values[NUM_GCOV_WORKING_SETS];
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index d6389c4..56391de 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -140,9 +140,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
int32:lineno_checksum int32:cfg_checksum
present: header int32:present
counts: header int64:count*
- summary: int32:checksum {count-summary}GCOV_COUNTERS_SUMMABLE
- count-summary: int32:num int32:runs int64:sum
- int64:max int64:sum_max histogram
+ summary: int32:checksum int32:num int32:runs int64:sum
+ int64:max int64:sum_max histogram
histogram: {int32:bitvector}8 histogram-buckets*
histogram-buckets: int32:num int64:min int64:sum
@@ -243,8 +242,7 @@ typedef uint64_t gcov_type_unsigned;
#define GCOV_TAG_COUNTER_NUM(LENGTH) ((LENGTH) / 2)
#define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000) /* Obsolete */
#define GCOV_TAG_PROGRAM_SUMMARY ((gcov_unsigned_t)0xa3000000)
-#define GCOV_TAG_SUMMARY_LENGTH(NUM) \
- (1 + GCOV_COUNTERS_SUMMABLE * (10 + 3 * 2) + (NUM) * 5)
+#define GCOV_TAG_SUMMARY_LENGTH(NUM) (1 + (10 + 3 * 2) + (NUM) * 5)
#define GCOV_TAG_AFDO_FILE_NAMES ((gcov_unsigned_t)0xaa000000)
#define GCOV_TAG_AFDO_FUNCTION ((gcov_unsigned_t)0xac000000)
#define GCOV_TAG_AFDO_WORKING_SET ((gcov_unsigned_t)0xaf000000)
@@ -259,13 +257,10 @@ GCOV_COUNTERS
};
#undef DEF_GCOV_COUNTER
-/* Counters which can be summaried. */
-#define GCOV_COUNTERS_SUMMABLE (GCOV_COUNTER_ARCS + 1)
-
/* The first of counters used for value profiling. They must form a
consecutive interval and their order must match the order of
HIST_TYPEs in value-prof.h. */
-#define GCOV_FIRST_VALUE_COUNTER GCOV_COUNTERS_SUMMABLE
+#define GCOV_FIRST_VALUE_COUNTER GCOV_COUNTER_V_INTERVAL
/* The last of counters used for value profiling. */
#define GCOV_LAST_VALUE_COUNTER (GCOV_COUNTERS - 1)
@@ -337,23 +332,18 @@ typedef struct
This is essentially a ceiling divide by 32 bits. */
#define GCOV_HISTOGRAM_BITVECTOR_SIZE (GCOV_HISTOGRAM_SIZE + 31) / 32
-/* Cumulative counter data. */
-struct gcov_ctr_summary
-{
- gcov_unsigned_t num; /* number of counters. */
- gcov_unsigned_t runs; /* number of program runs */
- gcov_type sum_all; /* sum of all counters accumulated. */
- gcov_type run_max; /* maximum value on a single run. */
- gcov_type sum_max; /* sum of individual run max values. */
- gcov_bucket_type histogram[GCOV_HISTOGRAM_SIZE]; /* histogram of
- counter values. */
-};
-
/* Object & program summary record. */
+
struct gcov_summary
{
- gcov_unsigned_t checksum; /* checksum of program */
- struct gcov_ctr_summary ctrs[GCOV_COUNTERS_SUMMABLE];
+ gcov_unsigned_t checksum; /* Checksum of program. */
+ gcov_unsigned_t num; /* Number of counters. */
+ gcov_unsigned_t runs; /* Number of program runs. */
+ gcov_type sum_all; /* Sum of all counters accumulated. */
+ gcov_type run_max; /* Maximum value on a single run. */
+ gcov_type sum_max; /* Sum of individual run max values. */
+ gcov_bucket_type histogram[GCOV_HISTOGRAM_SIZE]; /* Histogram of
+ counter values. */
};
#if !defined(inhibit_libc)
@@ -414,7 +404,7 @@ typedef struct gcov_working_set_info
gcov_type min_counter;
} gcov_working_set_t;
-GCOV_LINKAGE void compute_working_sets (const struct gcov_ctr_summary *summary,
+GCOV_LINKAGE void compute_working_sets (const gcov_summary *summary,
gcov_working_set_t *gcov_working_sets);
#endif
diff --git a/gcc/gcov.c b/gcc/gcov.c
index a2a5d1c..2114a43 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1801,7 +1801,7 @@ read_count_file (void)
{
struct gcov_summary summary;
gcov_read_summary (&summary);
- object_runs += summary.ctrs[GCOV_COUNTER_ARCS].runs;
+ object_runs += summary.runs;
program_count++;
}
else if (tag == GCOV_TAG_FUNCTION && !length)
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index b23d189..8439bab 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -1657,7 +1657,7 @@ input_refs (struct lto_input_block *ib,
}
-static struct gcov_ctr_summary lto_gcov_summary;
+static gcov_summary lto_gcov_summary;
/* Input profile_info from IB. */
static void
@@ -1715,7 +1715,7 @@ merge_profile_summaries (struct lto_file_decl_data **file_data_vec)
struct cgraph_node *node;
struct cgraph_edge *edge;
gcov_type saved_sum_all = 0;
- gcov_ctr_summary *saved_profile_info = 0;
+ gcov_summary *saved_profile_info = 0;
int saved_scale = 0;
/* Find unit with maximal number of runs. If we ever get serious about
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index d2006fad..025929f 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -582,7 +582,7 @@ struct GTY(()) lto_file_decl_data
vec<res_pair> GTY((skip)) respairs;
unsigned max_index;
- struct gcov_ctr_summary GTY((skip)) profile_info;
+ gcov_summary GTY((skip)) profile_info;
/* Map assigning declarations their resolutions. */
hash_map<tree, ld_plugin_symbol_resolution> * GTY((skip)) resolution_map;
diff --git a/gcc/profile.c b/gcc/profile.c
index 6fde0fd..8ba6dc7 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -84,7 +84,7 @@ struct bb_profile_info {
/* Counter summary from the last set of coverage counts read. */
-const struct gcov_ctr_summary *profile_info;
+const gcov_summary *profile_info;
/* Counter working set information computed from the current counter
summary. Not initialized unless profile_info summary is non-NULL. */
diff --git a/gcc/profile.h b/gcc/profile.h
index f710cf2..6b37bb6 100644
--- a/gcc/profile.h
+++ b/gcc/profile.h
@@ -75,6 +75,6 @@ extern void get_working_sets (void);
/* Counter summary from the last set of coverage counts read by
profile.c. */
-extern const struct gcov_ctr_summary *profile_info;
+extern const struct gcov_summary *profile_info;
#endif /* PROFILE_H */