+2014-11-27 Martin Liska <mliska@suse.cz>
+ David Malcolm <dmalcolm@redhat.com>
+
+ * ipa-icf.c (sem_function::equals_private): int* is replaced with
+ auto_vec.
+ (sem_function::bb_dict_test): Likewise.
+ * ipa-icf.h: Likewise.
+
2014-11-27 Richard Biener <rguenther@suse.de>
PR middle-end/64088
basic_block bb1, bb2;
edge e1, e2;
edge_iterator ei1, ei2;
- int *bb_dict = NULL;
bool result = true;
tree arg1, arg2;
dump_message ("All BBs are equal\n");
+ auto_vec <int> bb_dict;
+
/* Basic block edges check. */
for (unsigned i = 0; i < bb_sorted.length (); ++i)
{
- bb_dict = XNEWVEC (int, bb_sorted.length () + 2);
- memset (bb_dict, -1, (bb_sorted.length () + 2) * sizeof (int));
-
bb1 = bb_sorted[i]->bb;
bb2 = m_compared_func->bb_sorted[i]->bb;
corresponds to TARGET. */
bool
-sem_function::bb_dict_test (int* bb_dict, int source, int target)
+sem_function::bb_dict_test (auto_vec<int> bb_dict, int source, int target)
{
- if (bb_dict[source] == -1)
+ source++;
+ target++;
+
+ if (bb_dict.length () <= (unsigned)source)
+ bb_dict.safe_grow_cleared (source + 1);
+
+ if (bb_dict[source] == 0)
{
bb_dict[source] = target;
return true;
/* Basic blocks dictionary BB_DICT returns true if SOURCE index BB
corresponds to TARGET. */
- bool bb_dict_test (int* bb_dict, int source, int target);
+ bool bb_dict_test (auto_vec<int> bb_dict, int source, int target);
/* Iterates all tree types in T1 and T2 and returns true if all types
are compatible. If COMPARE_POLYMORPHIC is set to true,