This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: cse "library" routines
- To: Bernd Schmidt <bernds at balti dot cygnus dot co dot uk>
- Subject: Re: Patch: cse "library" routines
- From: Richard Henderson <rth at cygnus dot com>
- Date: Fri, 10 Mar 2000 16:01:54 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10003102016010.19492-100000@balti.cygnus.co.uk>
On Fri, Mar 10, 2000 at 08:40:09PM +0000, Bernd Schmidt wrote:
> This patch has already been reviewed by Joern Rennecke, but it still needs
> approval. It passed a bootstrap on x86 yesterday.
It looks generally good. Couple o questions --
> + /* A table that enables us to look up elts by their value. */
> + #define NBUCKETS 32
> + #define VALUE_HASH(V) ((V) % NBUCKETS)
> +
> + static cselib_val *table[NBUCKETS];
Why your own hash table implementation rather than one of the
couple of dictionary-type widgets we already have in libiberty?
> + static struct elt_list *
> + new_elt_list (next, elt)
[...]
> + el = (struct elt_list *) xmalloc (sizeof (struct elt_list));
[...]
> + new_elt_loc_list (next, loc)
[...]
> + el = (struct elt_loc_list *) xmalloc (sizeof (struct elt_loc_list));
I don't see a free to go along with these mallocs. Perhaps
you meant to do it in clear_table?
r~