Commit 1001fb60 by Richard Biener Committed by Richard Biener

re PR tree-optimization/54547 (FAIL: gcc.dg/tree-ssa/pr37508.c…

re PR tree-optimization/54547 (FAIL: gcc.dg/tree-ssa/pr37508.c scan-tree-dump-times vrp1 "Folding" 3)

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.

From-SVN: r193888
parent 6625d7bc
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> 2012-11-28 Eric Botcazou <ebotcazou@adacore.com>
* stor-layout.c (layout_type) <ARRAY_TYPE>: Do not clear TREE_OVERFLOW * stor-layout.c (layout_type) <ARRAY_TYPE>: Do not clear TREE_OVERFLOW
...@@ -541,22 +541,15 @@ set_and_canonicalize_value_range (value_range_t *vr, enum value_range_type t, ...@@ -541,22 +541,15 @@ set_and_canonicalize_value_range (value_range_t *vr, enum value_range_type t,
return; return;
} }
else if (TYPE_PRECISION (TREE_TYPE (min)) == 1 else if (TYPE_PRECISION (TREE_TYPE (min)) == 1
&& !TYPE_UNSIGNED (TREE_TYPE (min))
&& (is_min || is_max)) && (is_min || is_max))
{ {
/* For signed 1-bit precision, one is not in-range and /* Non-empty boolean ranges can always be represented
thus adding/subtracting it would result in overflows. */ as a singleton range. */
if (operand_equal_p (min, max, 0)) if (is_min)
{ min = max = vrp_val_max (TREE_TYPE (min));
min = max = is_min ? vrp_val_max (TREE_TYPE (min))
: vrp_val_min (TREE_TYPE (min));
t = VR_RANGE;
}
else else
{ min = max = vrp_val_min (TREE_TYPE (min));
set_value_range_to_varying (vr); t = VR_RANGE;
return;
}
} }
else if (is_min else if (is_min
/* As a special exception preserve non-null ranges. */ /* As a special exception preserve non-null ranges. */
...@@ -1707,7 +1700,8 @@ extract_range_from_assert (value_range_t *vr_p, tree expr) ...@@ -1707,7 +1700,8 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
&& vrp_val_is_max (max)) && vrp_val_is_max (max))
min = max = limit; 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) else if (cond_code == LE_EXPR || cond_code == LT_EXPR)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment