+2018-09-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/87402
+ * tree-ssa-sccvn.c (SSA_VISITED): Remove unused function.
+ (visit_phi): Re-instantiate handling of supposed to be VARYING
+ but non-VARYING backedge value.
+
2018-09-25 Richard Biener <rguenther@suse.de>
PR debug/83941
+2018-09-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/87402
+ * gcc.dg/torture/pr87402.c: New testcase.
+
2018-09-25 H.J. Lu <hongjiu.lu@intel.com>
PR testsuite/70150
return tem && tem->visited ? tem->valnum : x;
}
-/* Return whether X was visited. */
-
-inline bool
-SSA_VISITED (tree x)
-{
- vn_ssa_aux_t tem = vn_ssa_aux_hash->find_with_hash (x, SSA_NAME_VERSION (x));
- return tem && tem->visited;
-}
-
/* Return the SSA value of the VUSE x, supporting released VDEFs
during elimination which will value-number the VDEF to the
associated VUSE (but not substitute in the whole lattice). */
}
}
- /* If we value-number a virtual operand never value-number to the
+ /* If the value we want to use is flowing over the backedge and we
+ should take it as VARYING but it has a non-VARYING value drop to
+ VARYING.
+ 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
non-backedge everything is OK though. */
&& !seen_non_backedge
&& TREE_CODE (backedge_val) == SSA_NAME
&& sameval == backedge_val
- && SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val))
+ && (SSA_NAME_IS_VIRTUAL_OPERAND (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);