This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/50165] [4.7 Regression] Huge build time regression (Firefox lto build)
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Aug 2011 10:37:18 +0000
- Subject: [Bug lto/50165] [4.7 Regression] Huge build time regression (Firefox lto build)
- Auto-submitted: auto-generated
- References: <bug-50165-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50165
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-24 10:37:18 UTC ---
Btw, as ->len includes the trailing zero, the new hash function hashes in
a zero and the memcmp compares one byte unnecessarily. To make the transform
1:1 it would be
static inline hashval_t
hash_string_slot_node (const void *p)
{
const struct string_slot *ds = (const struct string_slot *) p;
hashval_t r = 0;
int i;
for (i = 0; i < ds->len - 1; i++)
r = r * 67 + (unsigned char)ds->s[i] - 113;
return r;
}
static inline int
eq_string_slot_node (const void *p1, const void *p2)
{
const struct string_slot *ds1 = (const struct string_slot *) p1;
const struct string_slot *ds2 = (const struct string_slot *) p2;
if (ds1->len == ds2->len)
return strncmp (ds1->s, ds2->s, ds1->len - 1) == 0;
return 0;
}
which, if it works fine, would be ok with me.