+2018-09-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/87211
+ * tree-ssa-sccvn.c (visit_phi): When value-numbering to a
+ backedge value we're supposed to treat as VARYING also number
+ the PHI to VARYING in case it got a different value-number already.
+
2018-09-04 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (vrp_can_optimize_bit_op): Remove.
2018-09-04 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/87211
+ * gcc.dg/torture/pr87211.c: New testcase.
+
+2018-09-04 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/87176
* gcc.dg/torture/pr87176.c: New testcase.
* gcc.dg/torture/ssa-fre-1.c: Likewise.
}
/* If the value we want to use is the backedge and that wasn't visited
- yet drop to VARYING. This only happens when not iterating.
+ yet or if we should take it as VARYING but it has a non-VARYING
+ value drop to VARYING. This only happens when not iterating.
If we value-number a virtual operand never value-number to the
value from the backedge as that confuses the alias-walking code.
See gcc.dg/torture/pr87176.c. If the value is the same on a
&& TREE_CODE (backedge_val) == SSA_NAME
&& sameval == backedge_val
&& (SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val)
- || !SSA_VISITED (backedge_val)))
+ || !SSA_VISITED (backedge_val)
+ || SSA_VAL (backedge_val) != backedge_val))
/* Note this just drops to VARYING without inserting the PHI into
the hashes. */
result = PHI_RESULT (phi);