This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/14699] abort() in hashtable.c in approx_sqrt() with -fmem-report


------- Additional Comments From belyshev at lubercy dot com  2004-05-04 16:56 -------
An updated patch here: http://gcc.gnu.org/ml/gcc-patches/2004-03/msg02049.html


2004-05-04  Serge Belyshev  <belyshev@lubercy.com>

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

diff -u hashtable.c.~1.16.~ hashtable.c
--- hashtable.c.~1.16.~	2003-08-23 02:29:17.000000000 +0400
+++ hashtable.c	2004-03-25 01:37:01.998704560 +0300
@@ -228,8 +228,8 @@
 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 exp_len, exp_len2, exp2_len, sum_of_squares;
   hashnode *p, *limit;
 
 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
@@ -248,7 +248,7 @@
 	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++;


Can anyone apply it as it was approved by Zack in
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg02117.html ?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14699


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]