From a5c965c17ef36c215673c1b3bc01eff0780b3fcc Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 14 Sep 2004 22:12:18 -0600 Subject: [PATCH] tree-dfa.c (free_df_for_stmt): No longer static. * tree-dfa.c (free_df_for_stmt): No longer static. (free_df): Update comments. * tree-flow.h (free_df_for_stmt): Prototype. * tree-ssa-dse.c (dse_optimize_stmt): Call free_df_for_stmt. Also call release_defs. From-SVN: r87531 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-dfa.c | 12 +++++++++--- gcc/tree-flow.h | 1 + gcc/tree-ssa-dse.c | 8 ++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a2f169c575d..f982042f9a5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-09-14 Jeff Law + + * tree-dfa.c (free_df_for_stmt): No longer static. + (free_df): Update comments. + * tree-flow.h (free_df_for_stmt): Prototype. + * tree-ssa-dse.c (dse_optimize_stmt): Call free_df_for_stmt. Also + call release_defs. + 2004-09-14 Diego Novillo PR tree-optimization/17252 diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 533b98884e6..3d7e4d4b4d6 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -188,9 +188,9 @@ compute_immediate_uses (int flags, bool (*calc_for)(tree)) } -/* Invalidates dataflow information for a statement STMT. */ +/* Invalidates dataflow information for a statement STMT. */ -static void +void free_df_for_stmt (tree stmt) { dataflow_t *df; @@ -221,7 +221,13 @@ free_df_for_stmt (tree stmt) } -/* Invalidate dataflow information for the whole function. */ +/* Invalidate dataflow information for the whole function. + + Note this only invalidates dataflow information on statements and + PHI nodes which are reachable. + + A deleted statement may still have attached dataflow information + on it. */ void free_df (void) diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 5f8c8d13c4e..2ae08f29404 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -530,6 +530,7 @@ extern void dump_immediate_uses_for (FILE *, tree); extern void debug_immediate_uses_for (tree); extern void compute_immediate_uses (int, bool (*)(tree)); extern void free_df (void); +extern void free_df_for_stmt (tree); extern tree get_virtual_var (tree); extern void add_referenced_tmp_var (tree var); extern void mark_new_vars_to_rename (tree, bitmap); diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index 4cc136bf2dd..23487f28b8e 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -326,6 +326,14 @@ dse_optimize_stmt (struct dom_walk_data *walk_data, This allows us to cascade dead stores. */ redirect_immediate_uses (stmt, skipped_phi ? skipped_phi : use); + /* Be sure to remove any dataflow information attached to + this statement. */ + free_df_for_stmt (stmt); + + /* And release any SSA_NAMEs set in this statement back to the + SSA_NAME manager. */ + release_defs (stmt); + /* Finally remove the dead store. */ bsi_remove (&bsi); } -- 2.30.2