aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-05-25 10:32:29 +0000
committerRichard Guenther <rguenther@suse.de>2011-05-25 10:32:29 +0000
commitadd02e3776f31556f6613dc9db5665122406f004 (patch)
tree5a9f070d5efb8e6683ef1f22cad58c083c40c85c /gcc/gimple.c
parent45fad086a1c37885373a00a28c10658f55226edb (diff)
2011-05-25 Richard Guenther <rguenther@suse.de>
* gimple.c (iterative_hash_canonical_type): Skip non-FIELD_DECLs. (gimple_canonical_types_compatible_p): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@174181 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 823892cb621..e13b3ed7883 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -4376,10 +4376,11 @@ iterative_hash_canonical_type (tree type, hashval_t val)
tree f;
for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f))
- {
- v = iterative_hash_canonical_type (TREE_TYPE (f), v);
- nf++;
- }
+ if (TREE_CODE (f) == FIELD_DECL)
+ {
+ v = iterative_hash_canonical_type (TREE_TYPE (f), v);
+ nf++;
+ }
v = iterative_hash_hashval_t (nf, v);
}
@@ -4688,6 +4689,13 @@ gimple_canonical_types_compatible_p (tree t1, tree t2)
f1 && f2;
f1 = TREE_CHAIN (f1), f2 = TREE_CHAIN (f2))
{
+ /* Skip non-fields. */
+ while (f1 && TREE_CODE (f1) != FIELD_DECL)
+ f1 = TREE_CHAIN (f1);
+ while (f2 && TREE_CODE (f2) != FIELD_DECL)
+ f2 = TREE_CHAIN (f2);
+ if (!f1 || !f2)
+ break;
/* The fields must have the same name, offset and type. */
if (DECL_NONADDRESSABLE_P (f1) != DECL_NONADDRESSABLE_P (f2)
|| !gimple_compare_field_offset (f1, f2)