aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-05-17 14:58:18 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-05-17 14:58:18 +0000
commit5beaf6643b97573248b35b857a7b2b07d90ba390 (patch)
tree2c050a144e814ee3632aef14c7866e2b5d00a803 /gcc
parentcc0fd50a42ec4bdb6f055b0d760c92994845128d (diff)
downloadgcc-5beaf6643b97573248b35b857a7b2b07d90ba390.zip
gcc-5beaf6643b97573248b35b857a7b2b07d90ba390.tar.gz
gcc-5beaf6643b97573248b35b857a7b2b07d90ba390.tar.bz2
gimple.c (type_hash_pair_compare): Fix comparison.
2011-05-17 Richard Guenther <rguenther@suse.de> * gimple.c (type_hash_pair_compare): Fix comparison. From-SVN: r173832
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/gimple.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3625d9b..0e30db8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2011-05-17 Richard Guenther <rguenther@suse.de>
+ * gimple.c (type_hash_pair_compare): Fix comparison.
+
+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.
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 0c07ac2..831ca31 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -4070,9 +4070,11 @@ type_hash_pair_compare (const void *p1_, const void *p2_)
{
const struct type_hash_pair *p1 = (const struct type_hash_pair *) p1_;
const struct type_hash_pair *p2 = (const struct type_hash_pair *) p2_;
- if (p1->hash == p2->hash)
- return TYPE_UID (p1->type) - TYPE_UID (p2->type);
- return p1->hash - p2->hash;
+ if (p1->hash < p2->hash)
+ return -1;
+ else if (p1->hash > p2->hash)
+ return 1;
+ return 0;
}
/* Returning a hash value for gimple type TYPE combined with VAL.