public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikhail Maltsev <maltsevm@gmail.com>
To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com
Subject: Re: [06/12] Consolidate string hashers
Date: Wed, 24 Jun 2015 10:13:00 -0000	[thread overview]
Message-ID: <558A82B2.5000803@gmail.com> (raw)
In-Reply-To: <87k2uua3a9.fsf@e105548-lin.cambridge.arm.com>

On 23.06.2015 17:49, Richard Sandiford wrote:
> This patch replaces various string hashers with a single copy
> in hash-traits.h.

(snip)

> Index: gcc/config/alpha/alpha.c
> ===================================================================
> --- gcc/config/alpha/alpha.c	2015-06-23 15:48:30.751788389 +0100
> +++ gcc/config/alpha/alpha.c	2015-06-23 15:48:30.747788453 +0100
> @@ -4808,13 +4808,7 @@ alpha_multipass_dfa_lookahead (void)
>  
>  struct GTY(()) alpha_links;
>  
> -struct string_traits : default_hashmap_traits
> -{
> -  static bool equal_keys (const char *const &a, const char *const &b)
> -  {
> -    return strcmp (a, b) == 0;
> -  }
> -};
> +typedef simple_hashmap_traits <nofree_string_hash> string_traits;
>  

I remember that when we briefly discussed unification of string traits,
a looked through GCC code and this one seemed weird to me: it does not
reimplement the hash function. I.e. the pointer value is used as hash. I
wonder, is it intentional or not? This could actually work if strings
are interned (but in that case there is no need to compare them, because
comparing pointers would be enough).

-- 
Regards,
    Mikhail Maltsev

  reply	other threads:[~2015-06-24 10:13 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87egl2bicm.fsf@e105548-lin.cambridge.arm.com>
2015-06-23 14:44 ` [01/12] Add hash_map traits that use existing hash_table-like traits Richard Sandiford
2015-06-25 16:34   ` Jeff Law
2015-06-23 14:45 ` [02/12] Move tree operand hashers to a new header file Richard Sandiford
2015-06-25 16:34   ` Jeff Law
2015-06-23 14:47 ` [03/12] Move decl hasher to " Richard Sandiford
2015-06-25 16:34   ` Jeff Law
2015-06-23 14:48 ` [04/12] Move ssa_name " Richard Sandiford
2015-06-25 16:35   ` Jeff Law
2015-06-23 14:49 ` [05/12] Move TREE_HASH " Richard Sandiford
2015-06-25 16:36   ` Jeff Law
2015-06-23 14:50 ` [06/12] Consolidate string hashers Richard Sandiford
2015-06-24 10:13   ` Mikhail Maltsev [this message]
2015-06-24 11:39     ` Richard Sandiford
2015-06-25 16:37   ` Jeff Law
2015-06-23 14:52 ` [07/12] Use new string hasher for MIPS Richard Sandiford
2015-06-25 16:39   ` Jeff Law
2015-06-23 14:53 ` [08/12] Add common traits for integer hash keys Richard Sandiford
2015-06-25 16:40   ` Jeff Law
2015-06-23 14:55 ` [09/12] Remove all but one use of default_hashmap_traits Richard Sandiford
2015-06-25 16:41   ` Jeff Law
2015-06-23 14:56 ` [10/12] Add helper class for valued-based empty and deleted slots Richard Sandiford
2015-06-25 16:41   ` Jeff Law
2015-06-23 14:57 ` [11/12] Remove default_hashmap_traits Richard Sandiford
2015-06-25 16:42   ` Jeff Law
2015-06-23 14:58 ` [12/12] Simplify uses of hash_map Richard Sandiford
2015-06-25 16:57   ` Jeff Law
2015-06-26 13:50     ` Rainer Orth
2015-06-26 14:38       ` Richard Sandiford
2015-06-26 14:39         ` Jan-Benedict Glaw
2015-06-26 15:34         ` Rainer Orth
2015-06-26 16:17           ` Richard Sandiford
2015-06-26 16:45             ` Richard Sandiford
2015-06-26 17:03               ` Richard Sandiford
2015-06-26 16:09       ` Mikhail Maltsev
2015-06-26 14:36   ` [BUILDROBOT] could not convert template argument ‘fill_decls_vec’ to ‘bool (*)(tree_node*&, tree_node**, auto_vec<cilk_decls>*)’ (was: [12/12] Simplify uses of hash_map) Jan-Benedict Glaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558A82B2.5000803@gmail.com \
    --to=maltsevm@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).