View | Details | Raw Unified | Return to bug 56113 | Differences between
and this patch

Collapse All | Expand All | Context: (Patch / File /
)

(-)gcc/tree-ssa-structalias.c (-6 / +22 lines)
 Lines 1907-1916   equiv_class_label_eq (const void *p1, co Link Here 
1907
}
1908
}
1908
1909
1909
/* Lookup a equivalence class in TABLE by the bitmap of LABELS it
1910
/* Lookup a equivalence class in TABLE by the bitmap of LABELS it
1910
   contains.  */
1911
   contains.  Sets *REF_LABELS to the bitmap LABELS is equivalent to.  */
1911
1912
1912
static unsigned int
1913
static unsigned int
1913
equiv_class_lookup (htab_t table, bitmap labels)
1914
equiv_class_lookup (htab_t table, bitmap labels, bitmap *ref_labels)
1914
{
1915
{
1915
  void **slot;
1916
  void **slot;
1916
  struct equiv_class_label ecl;
1917
  struct equiv_class_label ecl;
 Lines 1921-1929   equiv_class_lookup (htab_t table, bitmap Link Here 
1921
  slot = htab_find_slot_with_hash (table, &ecl,
1922
  slot = htab_find_slot_with_hash (table, &ecl,
1922
				   ecl.hashcode, NO_INSERT);
1923
				   ecl.hashcode, NO_INSERT);
1923
  if (!slot)
1924
  if (!slot)
1924
    return 0;
1925
    {
1926
      if (ref_labels)
1927
	*ref_labels = NULL;
1928
      return 0;
1929
    }
1925
  else
1930
  else
1926
    return ((equiv_class_label_t) *slot)->equivalence_class;
1931
    {
1932
      equiv_class_label_t ec = (equiv_class_label_t) *slot;
1933
      if (ref_labels)
1934
	*ref_labels = ec->labels;
1935
      return ec->equivalence_class;
1936
    }
1927
}
1937
}
1928
1938
1929
1939
 Lines 2123-2136   label_visit (constraint_graph_t graph, s Link Here 
2123
2133
2124
  if (!bitmap_empty_p (graph->points_to[n]))
2134
  if (!bitmap_empty_p (graph->points_to[n]))
2125
    {
2135
    {
2136
      bitmap ref_points_to;
2126
      unsigned int label = equiv_class_lookup (pointer_equiv_class_table,
2137
      unsigned int label = equiv_class_lookup (pointer_equiv_class_table,
2127
					       graph->points_to[n]);
2138
					       graph->points_to[n],
2139
					       &ref_points_to);
2128
      if (!label)
2140
      if (!label)
2129
	{
2141
	{
2130
	  label = pointer_equiv_class++;
2142
	  label = pointer_equiv_class++;
2131
	  equiv_class_add (pointer_equiv_class_table,
2143
	  equiv_class_add (pointer_equiv_class_table,
2132
			   label, graph->points_to[n]);
2144
			   label, graph->points_to[n]);
2133
	}
2145
	}
2146
      else
2147
	{
2148
	  BITMAP_FREE (graph->points_to[n]);
2149
	  graph->points_to[n] = ref_points_to;
2150
	}
2134
      graph->pointer_label[n] = label;
2151
      graph->pointer_label[n] = label;
2135
    }
2152
    }
2136
}
2153
}
 Lines 2190-2196   perform_var_substitution (constraint_gra Link Here 
2190
      /* Look up the location equivalence label if one exists, or make
2223
      /* Look up the location equivalence label if one exists, or make
2191
	 one otherwise.  */
2224
	 one otherwise.  */
2192
      label = equiv_class_lookup (location_equiv_class_table,
2225
      label = equiv_class_lookup (location_equiv_class_table,
2193
				  pointed_by);
2226
				  pointed_by, NULL);
2194
      if (label == 0)
2227
      if (label == 0)
2195
	{
2228
	{
2196
	  label = location_equiv_class++;
2229
	  label = location_equiv_class++;

Return to bug 56113