Normalize unsigned ~[0,0] into [1,MAX].
From-SVN: r276949
This commit is contained in:
parent
103197a183
commit
dede82f21b
@ -1,3 +1,10 @@
|
||||
2019-10-14 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-vrp.c (value_range_base::set): Normalize unsigned ~[0,0]
|
||||
into [1,MAX].
|
||||
* tree-vrp.h (value_range_base::nonzero_p): Adjust for unsigned
|
||||
non-zero being represented as [1,MAX].
|
||||
|
||||
2019-10-14 Xiong Hu Luo <luoxhu@linux.ibm.com>
|
||||
|
||||
* tree-sra.c (dump_access): Add missing braces.
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-10-14 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* gcc.dg/tree-ssa/evrp4.c: Adjust for unsigned non-zero being
|
||||
[1,MAX].
|
||||
|
||||
2019-10-13 Iain Sandoe <iain@sandoe.co.uk>
|
||||
|
||||
* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
|
||||
|
@ -17,4 +17,4 @@ int bar (struct st *s)
|
||||
foo (&s->a);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump "\~\\\[0B, 0B\\\]" "evrp" } } */
|
||||
/* { dg-final { scan-tree-dump "\\\[1B, -1B\\\]" "evrp" } } */
|
||||
|
@ -800,13 +800,13 @@ value_range_base::set (enum value_range_kind kind, tree min, tree max)
|
||||
kind = VR_RANGE;
|
||||
}
|
||||
else if (is_min
|
||||
/* As a special exception preserve non-null ranges. */
|
||||
&& !(TYPE_UNSIGNED (TREE_TYPE (min))
|
||||
&& integer_zerop (max)))
|
||||
/* Allow non-zero pointers to be normalized to [1,MAX]. */
|
||||
|| (POINTER_TYPE_P (TREE_TYPE (min))
|
||||
&& integer_zerop (min)))
|
||||
{
|
||||
tree one = build_int_cst (TREE_TYPE (max), 1);
|
||||
min = int_const_binop (PLUS_EXPR, max, one);
|
||||
max = vrp_val_max (TREE_TYPE (max));
|
||||
max = vrp_val_max (TREE_TYPE (max), true);
|
||||
kind = VR_RANGE;
|
||||
}
|
||||
else if (is_max)
|
||||
|
@ -245,16 +245,6 @@ value_range_base::zero_p () const
|
||||
&& integer_zerop (m_max));
|
||||
}
|
||||
|
||||
/* Return TRUE if range is nonzero. */
|
||||
|
||||
inline bool
|
||||
value_range_base::nonzero_p () const
|
||||
{
|
||||
return (m_kind == VR_ANTI_RANGE
|
||||
&& integer_zerop (m_min)
|
||||
&& integer_zerop (m_max));
|
||||
}
|
||||
|
||||
extern void dump_value_range (FILE *, const value_range *);
|
||||
extern void dump_value_range (FILE *, const value_range_base *);
|
||||
|
||||
@ -322,6 +312,23 @@ extern tree get_single_symbol (tree, bool *, tree *);
|
||||
extern void maybe_set_nonzero_bits (edge, tree);
|
||||
extern value_range_kind determine_value_range (tree, wide_int *, wide_int *);
|
||||
|
||||
/* Return TRUE if range is nonzero. */
|
||||
|
||||
inline bool
|
||||
value_range_base::nonzero_p () const
|
||||
{
|
||||
if (m_kind == VR_ANTI_RANGE
|
||||
&& !TYPE_UNSIGNED (type ())
|
||||
&& integer_zerop (m_min)
|
||||
&& integer_zerop (m_max))
|
||||
return true;
|
||||
|
||||
return (m_kind == VR_RANGE
|
||||
&& TYPE_UNSIGNED (type ())
|
||||
&& integer_onep (m_min)
|
||||
&& vrp_val_is_max (m_max, true));
|
||||
}
|
||||
|
||||
/* Return TRUE if *VR includes the value zero. */
|
||||
|
||||
inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user