aboutsummaryrefslogtreecommitdiff
path: root/libiberty/hashtab.c
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-06 15:40:54 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-06 15:40:54 +0000
commit36c920021af6af270b5589417ee1e5ad7311e41e (patch)
tree146705cbed2fdf5ab54949aa16089558e9056763 /libiberty/hashtab.c
parent36e05e80a04b4c8fffd5603ba7b30a17d099dc56 (diff)
2013-05-06 David Edelsohn <dje.gcc@gmail.com>
Peter Bergner <bergner@vnet.ibm.com> Segher Boessenkool <segher@kernel.crashing.org> Jakub Jelinek <jakub@redhat.com> * hashtab.c (hash_pointer): Remove conditional and avoid unexecuted shift equal to wordsize. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198633 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/hashtab.c')
-rw-r--r--libiberty/hashtab.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index a2fe3ee3bdd..04607ea6a01 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -990,17 +990,8 @@ hash_pointer (const PTR p)
unsigned a, b, c;
a = b = 0x9e3779b9;
- if (sizeof (intptr_t) == 4)
- {
- /* Mix as 16bit for now */
- a += v >> 16;
- b += v & 0xffff;
- }
- else
- {
- a += v >> 32;
- b += v & 0xffffffff;
- }
+ a += v >> (sizeof (intptr_t) * CHAR_BIT / 2);
+ b += v & (((intptr_t) 1 << (sizeof (intptr_t) * CHAR_BIT / 2)) - 1);
c = 0x42135234;
mix (a, b, c);
return c;