+2011-01-21 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/47053
+ * tree-ssa-dse.c (need_eh_cleanup): New bitmap.
+ (dse_optimize_stmt): Set the appropriate bit in NEED_EH_CLEANUP when
+ statements are deleted.
+ (tree_ssa_dse): Allocate & free NEED_EH_CLEANUP. If NEED_EH_CLEANUP
+ is nonempty, then purge dead edges and cleanup the CFG.
+
2011-01-21 Alexandre Oliva <aoliva@redhat.com>
PR debug/47402
bitmap stores;
};
+/* Bitmap of blocks that have had EH statements cleaned. We should
+ remove their dead edges eventually. */
+static bitmap need_eh_cleanup;
+
static bool gate_dse (void);
static unsigned int tree_ssa_dse (void);
static void dse_initialize_block_local_data (struct dom_walk_data *,
/* Then we need to fix the operand of the consuming stmt. */
unlink_stmt_vdef (stmt);
+ bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index);
+
/* Remove the dead store. */
gsi_remove (&gsi, true);
struct dom_walk_data walk_data;
struct dse_global_data dse_gd;
+ need_eh_cleanup = BITMAP_ALLOC (NULL);
+
renumber_gimple_stmt_uids ();
/* We might consider making this a property of each pass so that it
/* Release the main bitmap. */
BITMAP_FREE (dse_gd.stores);
+ /* Removal of stores may make some EH edges dead. Purge such edges from
+ the CFG as needed. */
+ if (!bitmap_empty_p (need_eh_cleanup))
+ {
+ gimple_purge_all_dead_eh_edges (need_eh_cleanup);
+ cleanup_tree_cfg ();
+ }
+
+ BITMAP_FREE (need_eh_cleanup);
+
/* For now, just wipe the post-dominator information. */
free_dominance_info (CDI_POST_DOMINATORS);
return 0;