+2017-09-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/82217
+ * tree-ssa-sccvn.c (visit_phi): Properly handle all VN_TOP
+ but not undefined case.
+
2017-09-15 Jakub Jelinek <jakub@redhat.com>
PR target/82145
+2017-09-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/82217
+ * gcc.dg/torture/pr82217.c: New testcase.
+
2017-09-15 Jakub Jelinek <jakub@redhat.com>
PR target/82145
if only a single edge is exectuable use its value. */
if (n_executable <= 1)
result = seen_undef ? seen_undef : sameval;
- /* If we saw only undefined values create a new undef SSA name to
- avoid false equivalences. */
+ /* If we saw only undefined values and VN_TOP use one of the
+ undefined values. */
else if (sameval == VN_TOP)
- {
- gcc_assert (seen_undef);
- result = seen_undef;
- }
+ result = seen_undef ? seen_undef : sameval;
/* First see if it is equivalent to a phi node in this block. We prefer
this as it allows IV elimination - see PRs 66502 and 67167. */
else if ((result = vn_phi_lookup (phi)))