+2012-11-28 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/54547
+ * tree-vrp.c (set_and_canonicalize_value_range): Handle
+ 1-bit anti-ranges explicitely.
+ (extract_range_from_assert): Properly canonicalize all
+ built anti-ranges.
+
2012-11-28 Eric Botcazou <ebotcazou@adacore.com>
* stor-layout.c (layout_type) <ARRAY_TYPE>: Do not clear TREE_OVERFLOW
return;
}
else if (TYPE_PRECISION (TREE_TYPE (min)) == 1
- && !TYPE_UNSIGNED (TREE_TYPE (min))
&& (is_min || is_max))
{
- /* For signed 1-bit precision, one is not in-range and
- thus adding/subtracting it would result in overflows. */
- if (operand_equal_p (min, max, 0))
- {
- min = max = is_min ? vrp_val_max (TREE_TYPE (min))
- : vrp_val_min (TREE_TYPE (min));
- t = VR_RANGE;
- }
+ /* Non-empty boolean ranges can always be represented
+ as a singleton range. */
+ if (is_min)
+ min = max = vrp_val_max (TREE_TYPE (min));
else
- {
- set_value_range_to_varying (vr);
- return;
- }
+ min = max = vrp_val_min (TREE_TYPE (min));
+ t = VR_RANGE;
}
else if (is_min
/* As a special exception preserve non-null ranges. */
&& vrp_val_is_max (max))
min = max = limit;
- set_value_range (vr_p, VR_ANTI_RANGE, min, max, vr_p->equiv);
+ set_and_canonicalize_value_range (vr_p, VR_ANTI_RANGE,
+ min, max, vr_p->equiv);
}
else if (cond_code == LE_EXPR || cond_code == LT_EXPR)
{