+2019-03-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89789
+ * tree-ssa-sccvn.c (set_ssa_val_to): Do not allow lattice
+ changes from non-undefined back to undefined.
+
2019-03-25 Thomas Otto <thomas.otto@pdv-fs.de>
* dwarf2out.c (comp_dir_string): cached_wd could be set to both a
+2019-03-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89789
+ * gcc.dg/torture/pr89789.c: New testcase.
+
2019-03-25 Nathan Sidwell <nathan@acm.org>
* g++.dg/abi/lambda-static-1.C: New.
}
return false;
}
- else if (currval != VN_TOP
- && ! is_gimple_min_invariant (currval)
- && ! ssa_undefined_value_p (currval, false)
- && is_gimple_min_invariant (to))
+ bool curr_invariant = is_gimple_min_invariant (currval);
+ bool curr_undefined = (TREE_CODE (currval) == SSA_NAME
+ && ssa_undefined_value_p (currval, false));
+ if (currval != VN_TOP
+ && !curr_invariant
+ && !curr_undefined
+ && is_gimple_min_invariant (to))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
}
to = from;
}
+ else if (currval != VN_TOP
+ && !curr_undefined
+ && TREE_CODE (to) == SSA_NAME
+ && ssa_undefined_value_p (to, false))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Forcing VARYING instead of changing "
+ "value number of ");
+ print_generic_expr (dump_file, from);
+ fprintf (dump_file, " from ");
+ print_generic_expr (dump_file, currval);
+ fprintf (dump_file, " (non-undefined) to ");
+ print_generic_expr (dump_file, to);
+ fprintf (dump_file, " (undefined)\n");
+ }
+ to = from;
+ }
else if (TREE_CODE (to) == SSA_NAME
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (to))
to = from;