+2011-07-04 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2011-05-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/48822
+ * tree-ssa-sccvn.c (set_ssa_val_to): Never go up the lattice.
+
2011-07-04 Richard Guenther <rguenther@suse.de>
Backport from mainline
+2011-07-04 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2011-05-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/48822
+ * gcc.dg/torture/pr48822.c: New testcase.
+
2011-07-04 Richard Guenther <rguenther@suse.de>
Backport from mainline
static inline bool
set_ssa_val_to (tree from, tree to)
{
- tree currval;
+ tree currval = SSA_VAL (from);
- if (from != to
- && TREE_CODE (to) == SSA_NAME
- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (to))
- to = from;
+ if (from != to)
+ {
+ if (currval == from)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Not changing value number of ");
+ print_generic_expr (dump_file, from, 0);
+ fprintf (dump_file, " from VARYING to ");
+ print_generic_expr (dump_file, to, 0);
+ fprintf (dump_file, "\n");
+ }
+ return false;
+ }
+ else if (TREE_CODE (to) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (to))
+ to = from;
+ }
/* The only thing we allow as value numbers are VN_TOP, ssa_names
and invariants. So assert that here. */
print_generic_expr (dump_file, to, 0);
}
- currval = SSA_VAL (from);
-
if (currval != to && !operand_equal_p (currval, to, OEP_PURE_SAME))
{
VN_INFO (from)->valnum = to;