From: Thomas Preud'homme Date: Tue, 21 Apr 2015 10:23:25 +0000 (+0000) Subject: df-core.c (df_finish_pass): Iterate over df->problems_by_index[] and use df_remove_pr... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f252203d8d1bd6d5db396b42deb22b855809dfb;p=gcc.git df-core.c (df_finish_pass): Iterate over df->problems_by_index[] and use df_remove_problem rather than... 2015-04-21 Thomas Preud'homme * 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[]. From-SVN: r222260 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 64e9aae187b..73ede9eada0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-04-21 Thomas Preud'homme + + * 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 PR tree-optimization/65802 diff --git a/gcc/df-core.c b/gcc/df-core.c index 82f136436bb..67040a10d39 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -642,7 +642,6 @@ void df_finish_pass (bool verify ATTRIBUTE_UNUSED) { int i; - int removed = 0; #ifdef ENABLE_DF_CHECKING int saved_flags; @@ -658,21 +657,15 @@ df_finish_pass (bool verify ATTRIBUTE_UNUSED) 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;