Hi Vladimir,

  I am trying to fix a potential bug of cost_classes_eq in ira-costs.c. This 
patch is for gcc-4.8 branch and should work for gcc-4.9.
  Library function memcmp return 0 if no difference for the two compared data. 
Please take a look.
  
  
/* Compares cost classes info V1 and V2.  */
static int
cost_classes_eq (const void *v1, const void *v2)
{
  const_cost_classes_t hv1 = (const_cost_classes_t) v1;
  const_cost_classes_t hv2 = (const_cost_classes_t) v2;

  return hv1->num == hv2->num && memcmp (hv1->classes, hv2->classes,
-                                        sizeof (enum reg_class) * hv1->num);
+                                        sizeof (enum reg_class) * hv1->num) == 
0;
}

Cheers,
Fei

Reply via email to