This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/14699] abort() in hashtable.c in approx_sqrt() with -fmem-report
- From: "belyshev at lubercy dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2004 16:56:32 -0000
- Subject: [Bug preprocessor/14699] abort() in hashtable.c in approx_sqrt() with -fmem-report
- References: <20040323221847.14699.belyshev@lubercy.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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