+2019-10-28 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ PR tree-optimization/92163
+ * tree-ssa-dse.c (delete_dead_or_redundant_assignment): New param
+ need_eh_cleanup with default value NULL. Gate on need_eh_cleanup
+ before calling bitmap_set_bit.
+ (dse_optimize_redundant_stores): Pass global need_eh_cleanup to
+ delete_dead_or_redundant_assignment.
+ (dse_dom_walker::dse_optimize_stmt): Likewise.
+ * tree-ssa-dse.h (delete_dead_or_redundant_assignment): Adjust prototype.
+
2019-10-28 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR middle-end/91272
fact, they are the same transformation applied to different views of
the CFG. */
-void delete_dead_or_redundant_assignment (gimple_stmt_iterator *, const char *);
static void delete_dead_or_redundant_call (gimple_stmt_iterator *, const char *);
/* Bitmap of blocks that have had EH statements cleaned. We should
{
gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
if (is_gimple_assign (use_stmt))
- delete_dead_or_redundant_assignment (&gsi, "redundant");
+ delete_dead_or_redundant_assignment (&gsi, "redundant",
+ need_eh_cleanup);
else if (is_gimple_call (use_stmt))
delete_dead_or_redundant_call (&gsi, "redundant");
else
/* Delete a dead store at GSI, which is a gimple assignment. */
void
-delete_dead_or_redundant_assignment (gimple_stmt_iterator *gsi, const char *type)
+delete_dead_or_redundant_assignment (gimple_stmt_iterator *gsi, const char *type,
+ bitmap need_eh_cleanup)
{
gimple *stmt = gsi_stmt (*gsi);
if (dump_file && (dump_flags & TDF_DETAILS))
/* Remove the dead store. */
basic_block bb = gimple_bb (stmt);
- if (gsi_remove (gsi, true))
+ if (gsi_remove (gsi, true) && need_eh_cleanup)
bitmap_set_bit (need_eh_cleanup, bb->index);
/* And release any SSA_NAMEs set in this statement back to the
&& !by_clobber_p)
return;
- delete_dead_or_redundant_assignment (gsi, "dead");
+ delete_dead_or_redundant_assignment (gsi, "dead", need_eh_cleanup);
}
}
dse_store_status dse_classify_store (ao_ref *, gimple *, bool, sbitmap,
bool * = NULL, tree = NULL);
-void delete_dead_or_redundant_assignment (gimple_stmt_iterator *, const char *);
+void delete_dead_or_redundant_assignment (gimple_stmt_iterator *, const char *,
+ bitmap = NULL);
#endif /* GCC_TREE_SSA_DSE_H */