2017-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/83418
* vr-values.c (vr_values::extract_range_for_var_from_comparison_expr):
Instead of asserting we don't get unfolded comparisons deal with
them.
* gcc.dg/torture/pr83418.c: New testcase.
From-SVN: r255628
+2017-12-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/83418
+ * vr-values.c (vr_values::extract_range_for_var_from_comparison_expr):
+ Instead of asserting we don't get unfolded comparisons deal with
+ them.
+
2017-12-14 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/83396
+2017-12-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/83418
+ * gcc.dg/torture/pr83418.c: New testcase.
+
2017-12-14 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/83396
--- /dev/null
+/* { dg-do compile } */
+
+void
+yj (int j4)
+{
+ int t3;
+
+ for (t3 = 0; t3 < 6; ++t3)
+ {
+ short int v4 = t3;
+
+ if (v4 == j4 || v4 > t3)
+ for (;;)
+ {
+ }
+ }
+}
tree min, max, type;
value_range *limit_vr;
type = TREE_TYPE (var);
- gcc_assert (limit != var);
/* For pointer arithmetic, we only keep track of pointer equality
- and inequality. */
- if (POINTER_TYPE_P (type) && cond_code != NE_EXPR && cond_code != EQ_EXPR)
+ and inequality. If we arrive here with unfolded conditions like
+ _1 > _1 do not derive anything. */
+ if ((POINTER_TYPE_P (type) && cond_code != NE_EXPR && cond_code != EQ_EXPR)
+ || limit == var)
{
set_value_range_to_varying (vr_p);
return;