Don't use range_info_get_range for pointers.
Pointers only track null and nonnull, so we need to handle them specially. * tree-ssanames.cc (set_range_info): Use get_ptr_info for pointers rather than range_info_get_range.
This commit is contained in:
parent
5f18797450
commit
d8808c37d2
1 changed files with 8 additions and 7 deletions
|
@ -420,15 +420,11 @@ set_range_info (tree name, const vrange &r)
|
|||
|
||||
// Pick up the current range, or VARYING if none.
|
||||
tree type = TREE_TYPE (name);
|
||||
Value_Range tmp (type);
|
||||
if (range_info_p (name))
|
||||
range_info_get_range (name, tmp);
|
||||
else
|
||||
tmp.set_varying (type);
|
||||
|
||||
if (POINTER_TYPE_P (type))
|
||||
{
|
||||
if (r.nonzero_p () && !tmp.nonzero_p ())
|
||||
struct ptr_info_def *pi = get_ptr_info (name);
|
||||
// If R is nonnull and pi is not, set nonnull.
|
||||
if (r.nonzero_p () && (!pi || pi->pt.null))
|
||||
{
|
||||
set_ptr_nonnull (name);
|
||||
return true;
|
||||
|
@ -436,6 +432,11 @@ set_range_info (tree name, const vrange &r)
|
|||
return false;
|
||||
}
|
||||
|
||||
Value_Range tmp (type);
|
||||
if (range_info_p (name))
|
||||
range_info_get_range (name, tmp);
|
||||
else
|
||||
tmp.set_varying (type);
|
||||
// If the result doesn't change, or is undefined, return false.
|
||||
if (!tmp.intersect (r) || tmp.undefined_p ())
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue