This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: convenience routines for hashtab.c
- To: vonbrand at sleipnir dot valparaiso dot cl
- Subject: Re: Patch: convenience routines for hashtab.c
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Wed, 03 May 2000 20:40:32 -0700
- Cc: lucier at math dot purdue dot edu, gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <lucier@math.purdue.edu><200005040143.e441hZa10103@sleipnir.valparaiso.cl>
>>>>> "Horst" == Horst von Brand <vonbrand@sleipnir.valparaiso.cl> writes:
Horst> This way, you loose the last 3 bits, which are very likely
Horst> to be zeroes anyway
That's a good observation.
But it's not always true -- pointers inside structures, strings,
etc. generally don't obey this rule. Objects allocated by ggc_alloc
are only four-byte aligned in some cases.
Profiling is key here. If we're seeing lots of time in hashing, and
we observe that to be due to the low-order bits being zero, then we
should definitely do this. Otherwise, I think we should just leave
the code as simple as possible.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com