mirror of git://gcc.gnu.org/git/gcc.git
tree-vrp.c (set_and_canonicalize_value_range): Use canonical predicates to set VR_UNDEFINED and VR_VARYING.
2012-06-15 Richard Guenther <rguenther@suse.de> * tree-vrp.c (set_and_canonicalize_value_range): Use canonical predicates to set VR_UNDEFINED and VR_VARYING. Drop a case we assert for in set_value_range to VR_VARYING. From-SVN: r188663
This commit is contained in:
parent
dae840fcd3
commit
ef5ad3b745
|
|
@ -1,3 +1,9 @@
|
|||
2012-06-15 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* tree-vrp.c (set_and_canonicalize_value_range): Use canonical
|
||||
predicates to set VR_UNDEFINED and VR_VARYING. Drop a case
|
||||
we assert for in set_value_range to VR_VARYING.
|
||||
|
||||
2012-06-15 Richard Earnshaw <rearnsha@arm.com>
|
||||
|
||||
* arm.md (addsf3, adddf3): Use s_register_operand.
|
||||
|
|
|
|||
|
|
@ -386,6 +386,18 @@ nonnull_arg_p (const_tree arg)
|
|||
}
|
||||
|
||||
|
||||
/* Set value range VR to VR_UNDEFINED. */
|
||||
|
||||
static inline void
|
||||
set_value_range_to_undefined (value_range_t *vr)
|
||||
{
|
||||
vr->type = VR_UNDEFINED;
|
||||
vr->min = vr->max = NULL_TREE;
|
||||
if (vr->equiv)
|
||||
bitmap_clear (vr->equiv);
|
||||
}
|
||||
|
||||
|
||||
/* Set value range VR to VR_VARYING. */
|
||||
|
||||
static inline void
|
||||
|
|
@ -463,10 +475,20 @@ static void
|
|||
set_and_canonicalize_value_range (value_range_t *vr, enum value_range_type t,
|
||||
tree min, tree max, bitmap equiv)
|
||||
{
|
||||
/* Nothing to canonicalize for symbolic or unknown or varying ranges. */
|
||||
if ((t != VR_RANGE
|
||||
&& t != VR_ANTI_RANGE)
|
||||
|| TREE_CODE (min) != INTEGER_CST
|
||||
/* Use the canonical setters for VR_UNDEFINED and VR_VARYING. */
|
||||
if (t == VR_UNDEFINED)
|
||||
{
|
||||
set_value_range_to_undefined (vr);
|
||||
return;
|
||||
}
|
||||
else if (t == VR_VARYING)
|
||||
{
|
||||
set_value_range_to_varying (vr);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Nothing to canonicalize for symbolic ranges. */
|
||||
if (TREE_CODE (min) != INTEGER_CST
|
||||
|| TREE_CODE (max) != INTEGER_CST)
|
||||
{
|
||||
set_value_range (vr, t, min, max, equiv);
|
||||
|
|
@ -502,7 +524,8 @@ set_and_canonicalize_value_range (value_range_t *vr, enum value_range_type t,
|
|||
|
||||
if (is_min && is_max)
|
||||
{
|
||||
/* We cannot deal with empty ranges, drop to varying. */
|
||||
/* We cannot deal with empty ranges, drop to varying.
|
||||
??? This could be VR_UNDEFINED instead. */
|
||||
set_value_range_to_varying (vr);
|
||||
return;
|
||||
}
|
||||
|
|
@ -525,6 +548,15 @@ set_and_canonicalize_value_range (value_range_t *vr, enum value_range_type t,
|
|||
}
|
||||
}
|
||||
|
||||
/* Drop [-INF(OVF), +INF(OVF)] to varying. */
|
||||
if (needs_overflow_infinity (TREE_TYPE (min))
|
||||
&& is_overflow_infinity (min)
|
||||
&& is_overflow_infinity (max))
|
||||
{
|
||||
set_value_range_to_varying (vr);
|
||||
return;
|
||||
}
|
||||
|
||||
set_value_range (vr, t, min, max, equiv);
|
||||
}
|
||||
|
||||
|
|
@ -608,18 +640,6 @@ set_value_range_to_truthvalue (value_range_t *vr, tree type)
|
|||
}
|
||||
|
||||
|
||||
/* Set value range VR to VR_UNDEFINED. */
|
||||
|
||||
static inline void
|
||||
set_value_range_to_undefined (value_range_t *vr)
|
||||
{
|
||||
vr->type = VR_UNDEFINED;
|
||||
vr->min = vr->max = NULL_TREE;
|
||||
if (vr->equiv)
|
||||
bitmap_clear (vr->equiv);
|
||||
}
|
||||
|
||||
|
||||
/* If abs (min) < abs (max), set VR to [-max, max], if
|
||||
abs (min) >= abs (max), set VR to [-min, min]. */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue