summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-23 15:36:32 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-23 15:36:32 +0000
commit9c759c0a188641f1dfe0a39111a2c8c34984c740 (patch)
tree0706f7250689b401c6de0bf14243e448b01e7741
parent02617140bebf9050d51083e2f287673af3f6b246 (diff)
downloadgcc-9c759c0a188641f1dfe0a39111a2c8c34984c740.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174074 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gimple.c13
2 files changed, 11 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d045f3f5f92..b583601845a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
* c-typeck.c (build_function_call_vec): Tweak call to
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 4c7fbfc8235..d6c79aa1f5c 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3587,6 +3587,10 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p,
SCCs this assumption may get revisited. */
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 (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2)))
goto different_types;
@@ -3797,10 +3801,6 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p,
{
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 (f1 = TYPE_FIELDS (t1), f2 = TYPE_FIELDS (t2);
f1 && f2;
@@ -4093,7 +4093,8 @@ iterative_hash_gimple_type (tree type, hashval_t val,
smaller sets; when searching for existing matching types to merge,
only existing types having the same features as the new type will be
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 (TREE_ADDRESSABLE (type), v);
@@ -4175,8 +4176,6 @@ iterative_hash_gimple_type (tree type, hashval_t val,
unsigned nf;
tree f;
- v = iterative_hash_name (TYPE_NAME (type), v);
-
for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f))
{
v = iterative_hash_name (DECL_NAME (f), v);