summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-02 20:15:55 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-02 20:15:55 +0000
commit0cc06088adc97d6ca9e66489d8a23397fa86f80c (patch)
tree03e110a82bcb3ef30244905ac0866fc09e18c916 /gcc/tree-vrp.c
parent7e58afa1fccd88427cb22c4b94cffc49a30ea95c (diff)
downloadgcc-0cc06088adc97d6ca9e66489d8a23397fa86f80c.tar.gz
PR 24142
* tree-vrp.c (vrp_meet): Fix call to range_includes_zero_p in case of anti-ranges. testsuite/ PR 24142 * gcc.c-torture/execute/pr24142.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104874 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index de7a931cb15..7d7e0c9e9c3 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -3454,11 +3454,15 @@ vrp_meet (value_range_t *vr0, value_range_t *vr1)
no_meet:
/* The two range VR0 and VR1 do not meet. Before giving up and
setting the result to VARYING, see if we can at least derive a
- useful anti-range. */
+ useful anti-range. FIXME, all this nonsense about distinguishing
+ anti-ranges from ranges is necessary because of the odd
+ semantics of range_includes_zero_p and friends. */
if (!symbolic_range_p (vr0)
- && !range_includes_zero_p (vr0)
+ && ((vr0->type == VR_RANGE && !range_includes_zero_p (vr0))
+ || (vr0->type == VR_ANTI_RANGE && range_includes_zero_p (vr0)))
&& !symbolic_range_p (vr1)
- && !range_includes_zero_p (vr1))
+ && ((vr1->type == VR_RANGE && !range_includes_zero_p (vr1))
+ || (vr1->type == VR_ANTI_RANGE && range_includes_zero_p (vr1))))
{
set_value_range_to_nonnull (vr0, TREE_TYPE (vr0->min));