Commit e1caba18 by Richard Guenther Committed by Richard Biener

gimple.c (gimple_types_compatible_p_1): Always compare type names.

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

	* gimple.c (gimple_types_compatible_p_1): Always compare type names.
	(iterative_hash_gimple_type): Always hash type names.

From-SVN: r174074
parent 4d7f99c7
2011-05-23 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_types_compatible_p_1): Always compare type names.
(iterative_hash_gimple_type): Always hash type names.
2011-05-23 Nathan Froyd <froydnj@codesourcery.com> 2011-05-23 Nathan Froyd <froydnj@codesourcery.com>
* c-typeck.c (build_function_call_vec): Tweak call to * c-typeck.c (build_function_call_vec): Tweak call to
......
...@@ -3587,6 +3587,10 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p, ...@@ -3587,6 +3587,10 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p,
SCCs this assumption may get revisited. */ SCCs this assumption may get revisited. */
state->u.same_p = 1; state->u.same_p = 1;
/* The struct tags shall compare equal. */
if (!compare_type_names_p (t1, t2, false))
goto different_types;
/* If their attributes are not the same they can't be the same type. */ /* If their attributes are not the same they can't be the same type. */
if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2))) if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2)))
goto different_types; goto different_types;
...@@ -3797,10 +3801,6 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p, ...@@ -3797,10 +3801,6 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p,
{ {
tree f1, f2; tree f1, f2;
/* The struct tags shall compare equal. */
if (!compare_type_names_p (t1, t2, false))
goto different_types;
/* For aggregate types, all the fields must be the same. */ /* For aggregate types, all the fields must be the same. */
for (f1 = TYPE_FIELDS (t1), f2 = TYPE_FIELDS (t2); for (f1 = TYPE_FIELDS (t1), f2 = TYPE_FIELDS (t2);
f1 && f2; f1 && f2;
...@@ -4093,7 +4093,8 @@ iterative_hash_gimple_type (tree type, hashval_t val, ...@@ -4093,7 +4093,8 @@ iterative_hash_gimple_type (tree type, hashval_t val,
smaller sets; when searching for existing matching types to merge, smaller sets; when searching for existing matching types to merge,
only existing types having the same features as the new type will be only existing types having the same features as the new type will be
checked. */ checked. */
v = iterative_hash_hashval_t (TREE_CODE (type), 0); v = iterative_hash_name (TYPE_NAME (type), 0);
v = iterative_hash_hashval_t (TREE_CODE (type), v);
v = iterative_hash_hashval_t (TYPE_QUALS (type), v); v = iterative_hash_hashval_t (TYPE_QUALS (type), v);
v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v); v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v);
...@@ -4175,8 +4176,6 @@ iterative_hash_gimple_type (tree type, hashval_t val, ...@@ -4175,8 +4176,6 @@ iterative_hash_gimple_type (tree type, hashval_t val,
unsigned nf; unsigned nf;
tree f; tree f;
v = iterative_hash_name (TYPE_NAME (type), v);
for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f)) for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f))
{ {
v = iterative_hash_name (DECL_NAME (f), v); v = iterative_hash_name (DECL_NAME (f), v);
......
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