]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ira-costs.c (cost_classes_hasher::equal): Check equality of memcmp and 0 if no differ...
authorFelix Yang <felix.yang@huawei.com>
Mon, 30 Dec 2013 16:10:14 +0000 (16:10 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Mon, 30 Dec 2013 16:10:14 +0000 (16:10 +0000)
2013-12-30  Felix Yang  <felix.yang@huawei.com>

* ira-costs.c (cost_classes_hasher::equal): Check equality of
memcmp and 0 if no difference exists for HV1 and HV2.

From-SVN: r206246

gcc/ChangeLog
gcc/ira-costs.c

index b0870aa1f851552b32fb36b3a9cc35a107030ea5..635704a8be527d0b26fb19f3b2a69c4768ff8fbb 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-30  Felix Yang  <felix.yang@huawei.com>
+
+       * ira-costs.c (cost_classes_hasher::equal): Check equality of
+       memcmp and 0 if no difference exists for HV1 and HV2.
+
 2013-12-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/59501
index c8d64d5e50ace6a36c8b49ac65d591078a27ed83..1d9e1a4e337e945eda0e039603d0dce19fd7089b 100644 (file)
@@ -154,8 +154,9 @@ cost_classes_hasher::hash (const value_type *hv)
 inline bool
 cost_classes_hasher::equal (const value_type *hv1, const compare_type *hv2)
 {
-  return hv1->num == hv2->num && memcmp (hv1->classes, hv2->classes,
-                                        sizeof (enum reg_class) * hv1->num);
+  return (hv1->num == hv2->num
+         && memcmp (hv1->classes, hv2->classes,
+                    sizeof (enum reg_class) * hv1->num) == 0);
 }
 
 /* Delete cost classes info V from the hash table.  */