Commit 008bad7a by Richard Guenther Committed by Richard Biener

gimple.c (iterative_hash_gimple_type): Simplify singleton case some more, fix…

gimple.c (iterative_hash_gimple_type): Simplify singleton case some more, fix final hash value of the non-singleton case.

2011-05-17  Richard Guenther  <rguenther@suse.de>

	* gimple.c (iterative_hash_gimple_type): Simplify singleton
	case some more, fix final hash value of the non-singleton case.

From-SVN: r173829
parent 36461340
2011-05-17 Richard Guenther <rguenther@suse.de> 2011-05-17 Richard Guenther <rguenther@suse.de>
* gimple.c (iterative_hash_gimple_type): Simplify singleton
case some more, fix final hash value of the non-singleton case.
2011-05-17 Richard Guenther <rguenther@suse.de>
PR bootstrap/49013 PR bootstrap/49013
Revert Revert
2011-05-16 Richard Guenther <rguenther@suse.de> 2011-05-16 Richard Guenther <rguenther@suse.de>
......
...@@ -4213,25 +4213,24 @@ iterative_hash_gimple_type (tree type, hashval_t val, ...@@ -4213,25 +4213,24 @@ iterative_hash_gimple_type (tree type, hashval_t val,
if (state->low == state->dfsnum) if (state->low == state->dfsnum)
{ {
tree x; tree x;
struct sccs *cstate;
struct tree_int_map *m; struct tree_int_map *m;
/* Pop off the SCC and set its hash values. */ /* Pop off the SCC and set its hash values. */
x = VEC_pop (tree, *sccstack); x = VEC_pop (tree, *sccstack);
cstate = (struct sccs *)*pointer_map_contains (sccstate, x);
cstate->on_sccstack = false;
/* Optimize SCC size one. */ /* Optimize SCC size one. */
if (x == type) if (x == type)
{ {
state->on_sccstack = false;
m = ggc_alloc_cleared_tree_int_map (); m = ggc_alloc_cleared_tree_int_map ();
m->base.from = x; m->base.from = x;
m->to = cstate->u.hash; m->to = v;
slot = htab_find_slot (type_hash_cache, m, INSERT); slot = htab_find_slot (type_hash_cache, m, INSERT);
gcc_assert (!*slot); gcc_assert (!*slot);
*slot = (void *) m; *slot = (void *) m;
} }
else else
{ {
struct sccs *cstate;
unsigned first, i, size, j; unsigned first, i, size, j;
struct type_hash_pair *pairs; struct type_hash_pair *pairs;
/* Pop off the SCC and build an array of type, hash pairs. */ /* Pop off the SCC and build an array of type, hash pairs. */
...@@ -4241,6 +4240,8 @@ iterative_hash_gimple_type (tree type, hashval_t val, ...@@ -4241,6 +4240,8 @@ iterative_hash_gimple_type (tree type, hashval_t val,
size = VEC_length (tree, *sccstack) - first + 1; size = VEC_length (tree, *sccstack) - first + 1;
pairs = XALLOCAVEC (struct type_hash_pair, size); pairs = XALLOCAVEC (struct type_hash_pair, size);
i = 0; i = 0;
cstate = (struct sccs *)*pointer_map_contains (sccstate, x);
cstate->on_sccstack = false;
pairs[i].type = x; pairs[i].type = x;
pairs[i].hash = cstate->u.hash; pairs[i].hash = cstate->u.hash;
do do
...@@ -4275,6 +4276,8 @@ iterative_hash_gimple_type (tree type, hashval_t val, ...@@ -4275,6 +4276,8 @@ iterative_hash_gimple_type (tree type, hashval_t val,
for (j = 0; pairs[j].hash != pairs[i].hash; ++j) for (j = 0; pairs[j].hash != pairs[i].hash; ++j)
hash = iterative_hash_hashval_t (pairs[j].hash, hash); hash = iterative_hash_hashval_t (pairs[j].hash, hash);
m->to = hash; m->to = hash;
if (pairs[i].type == type)
v = hash;
slot = htab_find_slot (type_hash_cache, m, INSERT); slot = htab_find_slot (type_hash_cache, m, INSERT);
gcc_assert (!*slot); gcc_assert (!*slot);
*slot = (void *) m; *slot = (void *) m;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment