+2015-04-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/65875
+ * tree-vrp.c (update_value_range): If in is_new case setting
+ old_vr to VR_VARYING, also set new_vr to it. Remove
+ old_vr->type == VR_VARYING test.
+ (vrp_visit_phi_node): Return SSA_PROP_VARYING instead of
+ SSA_PROP_INTERESTING if update_value_range returned true,
+ but new range is VR_VARYING.
+
2015-04-27 Thomas Preud'homme <thomas.preudhomme@arm.com>
* combine.c (sign_extend_short_imm): New.
+2015-04-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/65875
+ * gcc.c-torture/compile/pr65875.c: New test.
+
2015-04-25 Marek Polacek <polacek@redhat.com>
PR c/52085
--- /dev/null
+/* PR tree-optimization/65875 */
+
+int a, b, c, d, e, f, g;
+
+void
+foo (void)
+{
+ long h = 0, i;
+ if (g < 0)
+ i = -g;
+ for (; b;)
+ for (; c;)
+ if (e)
+ h = 1;
+ for (; f;)
+ if (a)
+ break;
+ if (h > i)
+ while (h > i)
+ {
+ d = 0;
+ h--;
+ }
+}
if (is_new)
{
/* Do not allow transitions up the lattice. The following
- is slightly more awkward than just new_vr->type < old_vr->type
+ is slightly more awkward than just new_vr->type < old_vr->type
because VR_RANGE and VR_ANTI_RANGE need to be considered
the same. We may not have is_new when transitioning to
- UNDEFINED or from VARYING. */
- if (new_vr->type == VR_UNDEFINED
- || old_vr->type == VR_VARYING)
- set_value_range_to_varying (old_vr);
+ UNDEFINED. If old_vr->type is VARYING, we shouldn't be
+ called. */
+ if (new_vr->type == VR_UNDEFINED)
+ {
+ BITMAP_FREE (new_vr->equiv);
+ set_value_range_to_varying (old_vr);
+ set_value_range_to_varying (new_vr);
+ return true;
+ }
else
set_value_range (old_vr, new_vr->type, new_vr->min, new_vr->max,
new_vr->equiv);
fprintf (dump_file, "\n");
}
+ if (vr_result.type == VR_VARYING)
+ return SSA_PROP_VARYING;
+
return SSA_PROP_INTERESTING;
}