+2019-06-06 Richard Biener <rguenther@suse.de>
+
+ * vr-values.c (vr_values::extract_range_from_ssa_name): Do not
+ put equivalences on UNDEFINED ranges.
+ * gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children):
+ Make sure to drop defs of stmts added during simplification
+ to VARYING.
+
2019-06-06 Richard Biener <rguenther@suse.de>
* tree-ssa-structalias.c: Include tree-cfg.h.
/* Try folding stmts with the VR discovered. */
bool did_replace = evrp_folder.replace_uses_in (stmt);
+ gimple_stmt_iterator prev_gsi = gsi;
+ gsi_prev (&prev_gsi);
if (fold_stmt (&gsi, follow_single_use_edges)
|| did_replace)
{
if (did_replace)
{
+ /* If we wound up generating new stmts during folding
+ drop all their defs to VARYING. We can't easily
+ process them because we've already instantiated
+ ranges on uses on STMT that only hold after it. */
+ if (gsi_end_p (prev_gsi))
+ prev_gsi = gsi_start_bb (bb);
+ else
+ gsi_next (&prev_gsi);
+ while (gsi_stmt (prev_gsi) != gsi_stmt (gsi))
+ {
+ evrp_range_analyzer.get_vr_values ()
+ ->set_defs_to_varying (gsi_stmt (prev_gsi));
+ gsi_next (&prev_gsi);
+ }
+
/* If we cleaned up EH information from the statement,
remove EH edges. */
if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
else
vr->set (var);
- vr->equiv_add (var, get_value_range (var), &vrp_equiv_obstack);
+ if (!vr->undefined_p ())
+ vr->equiv_add (var, get_value_range (var), &vrp_equiv_obstack);
}
/* Extract range information from a binary expression OP0 CODE OP1 based on