+2015-04-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ * df-core.c (df_finish_pass): Iterate over df->problems_by_index[] and
+ use df_remove_problem rather than manually removing problems, leaving
+ holes in df->problems_in_order[].
+
2015-04-21 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/65802
df_finish_pass (bool verify ATTRIBUTE_UNUSED)
{
int i;
- int removed = 0;
#ifdef ENABLE_DF_CHECKING
int saved_flags;
saved_flags = df->changeable_flags;
#endif
- for (i = 0; i < df->num_problems_defined; i++)
+ /* We iterate over problems by index as each problem removed will
+ lead to problems_in_order to be reordered. */
+ for (i = 0; i < DF_LAST_PROBLEM_PLUS1; i++)
{
- struct dataflow *dflow = df->problems_in_order[i];
- struct df_problem *problem = dflow->problem;
+ struct dataflow *dflow = df->problems_by_index[i];
- if (dflow->optional_p)
- {
- gcc_assert (problem->remove_problem_fun);
- (problem->remove_problem_fun) ();
- df->problems_in_order[i] = NULL;
- df->problems_by_index[problem->id] = NULL;
- removed++;
- }
+ if (dflow && dflow->optional_p)
+ df_remove_problem (dflow);
}
- df->num_problems_defined -= removed;
/* Clear all of the flags. */
df->changeable_flags = 0;