diff options
author | James A. Morrison <phython@gcc.gnu.org> | 2005-07-29 15:22:07 +0000 |
---|---|---|
committer | James A. Morrison <phython@gcc.gnu.org> | 2005-07-29 15:22:07 +0000 |
commit | c7f927d3def70d2688494f65b4d79d9755f14a33 (patch) | |
tree | d9660d0e09f0dad3cad64576be6dbc0999cb14c1 /gcc/tree-vrp.c | |
parent | f717afe06628ac629c6a12496950aa59bb429a68 (diff) |
2005-07-29 James A. Morrison <phython@gcc.gnu.org>
* tree-vrp.c (compare_range_with_value): Return true or false
for ~[VAL_1, VAL_2] OP VAL if VAL_1 <= VAL <= VAL_2 for NE_EXPR and
EQ_EXPR respectively.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@102558 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 4afe4151a45..68960e547f6 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1753,9 +1753,8 @@ compare_range_with_value (enum tree_code comp, value_range_t *vr, tree val) || comp == LE_EXPR) return NULL_TREE; - /* ~[VAL, VAL] == VAL is always false. */ - if (compare_values (vr->min, val) == 0 - && compare_values (vr->max, val) == 0) + /* ~[VAL_1, VAL_2] OP VAL is known if VAL_1 <= VAL <= VAL_2. */ + if (value_inside_range (val, vr) == 1) return (comp == NE_EXPR) ? boolean_true_node : boolean_false_node; return NULL_TREE; |