From e9ee848dcdc644aa9cd57371fab0a70dba443424 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 23 Jan 2020 14:34:59 +0100 Subject: [PATCH] Remove wrong bail out in prune_topn_counter. * libgcov-driver.c (prune_topn_counter): Remove check for -1 as we only prune run-time counters that do not generate an invalid state. --- libgcc/ChangeLog | 6 ++++++ libgcc/libgcov-driver.c | 15 +++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 76c99465529..bd8cc383804 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-01-23 Martin Liska + + * libgcov-driver.c (prune_topn_counter): Remove + check for -1 as we only prune run-time counters + that do not generate an invalid state. + 2020-01-22 Martin Liska PR tree-optimization/92924 diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index cdb611de2a2..fb320738e1e 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -219,17 +219,12 @@ static struct gcov_fn_buffer *fn_buffer; static void prune_topn_counter (gcov_type *counters, gcov_type all) { - if (counters[1] == -1) - return; - for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) - { - if (counters[2 * i + 1] < all) - { - counters[2 * i] = 0; - counters[2 * i + 1] = 0; - } - } + if (counters[2 * i + 1] < all) + { + counters[2 * i] = 0; + counters[2 * i + 1] = 0; + } } /* Prune counters so that they are ready to store or merge. */ -- 2.30.2