[gcc(refs/users/ppalka/heads/libstdcxx-constrained-algos)] Remove wrong bail out in prune_topn_counter.

Patrick Palka ppalka@gcc.gnu.org
Sat Jan 25 22:53:00 GMT 2020


https://gcc.gnu.org/g:e9ee848dcdc644aa9cd57371fab0a70dba443424

commit e9ee848dcdc644aa9cd57371fab0a70dba443424
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Jan 23 14:34:59 2020 +0100

    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.

Diff:
---
 libgcc/ChangeLog        |  6 ++++++
 libgcc/libgcov-driver.c | 15 +++++----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 76c9946..bd8cc38 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-01-23  Martin Liska  <mliska@suse.cz>
+
+	* 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  <mliska@suse.cz>
 
 	PR tree-optimization/92924
diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c
index cdb611d..fb32073 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.  */



More information about the Gcc-cvs mailing list