re PR preprocessor/14699 (abort() in hashtable.c in approx_sqrt() with -fmem-report)
authorSerge Belyshev <belyshev@lubercy.com>
Mon, 6 Sep 2004 13:22:48 +0000 (13:22 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Mon, 6 Sep 2004 13:22:48 +0000 (13:22 +0000)
2004-09-06  Serge Belyshev  <belyshev@lubercy.com>

PR preprocessor/14699
* symtab.c (ht_dump_statistics): Change type of sum_of_squares
from size_t to double.

From-SVN: r87116

libcpp/ChangeLog
libcpp/symtab.c

index 802a5438fd27d43a7ec7417388df33614690d1a8..131f1881108861ad5d185181cff4f560bc6bc778 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-06  Serge Belyshev  <belyshev@lubercy.com>
+
+       PR preprocessor/14699
+       * symtab.c (ht_dump_statistics): Change type of sum_of_squares
+       from size_t to double.
+
 2004-08-28  Andreas Schwab  <schwab@suse.de>
            Andreas Jaeger <aj@suse.de>
 
index 9b2e0f1821115f97a050d9b2937f414b8fca2ecd..471765ca6974f537913639b01fe9077d32491d10 100644 (file)
@@ -252,8 +252,8 @@ void
 ht_dump_statistics (hash_table *table)
 {
   size_t nelts, nids, overhead, headers;
-  size_t total_bytes, longest, sum_of_squares;
-  double exp_len, exp_len2, exp2_len;
+  size_t total_bytes, longest;
+  double sum_of_squares, exp_len, exp_len2, exp2_len;
   hashnode *p, *limit;
 
 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
@@ -272,7 +272,7 @@ ht_dump_statistics (hash_table *table)
        size_t n = HT_LEN (*p);
 
        total_bytes += n;
-       sum_of_squares += n * n;
+       sum_of_squares += (double) n * n;
        if (n > longest)
          longest = n;
        nids++;