aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2013-11-28 16:15:52 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2013-11-28 16:15:52 +0000
commitf5c8b24c731e1b0343cbdcc3438ab4c40e82fc71 (patch)
tree217f4d30b00b58d646c8c06c615dd102545bacf3 /gcc/tree-vrp.c
parent3c716922ad6b887c3471cff5b9748d2e3ae3174d (diff)
downloadgcc-f5c8b24c731e1b0343cbdcc3438ab4c40e82fc71.zip
gcc-f5c8b24c731e1b0343cbdcc3438ab4c40e82fc71.tar.gz
gcc-f5c8b24c731e1b0343cbdcc3438ab4c40e82fc71.tar.bz2
tree-core.h (tree_base): Document use of static_flag for SSA_NAME.
gcc/ * tree-core.h (tree_base): Document use of static_flag for SSA_NAME. * tree.h (SSA_NAME_ANTI_RANGE_P, SSA_NAME_RANGE_TYPE): New macros. * tree-ssanames.h (set_range_info): Add range_type argument. (duplicate_ssa_name_range_info): Likewise. * tree-ssanames.c (set_range_info): Take the range type as argument and store it in SSA_NAME_ANTI_RANGE_P. (duplicate_ssa_name_range_info): Likewise. (get_range_info): Use SSA_NAME_ANTI_RANGE_P. (set_nonzero_bits): Update call to set_range_info. (duplicate_ssa_name_fn): Update call to duplicate_ssa_name_range_info. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-vrp.c (remove_range_assertions): Update call to set_range_info. (vrp_finalize): Likewise, passing anti-ranges directly. From-SVN: r205489
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 1ec9c16..ce2de47 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -6596,7 +6596,8 @@ remove_range_assertions (void)
&& all_imm_uses_in_stmt_or_feed_cond (var, stmt,
single_pred (bb)))
{
- set_range_info (var, SSA_NAME_RANGE_INFO (lhs)->min,
+ set_range_info (var, SSA_NAME_RANGE_TYPE (lhs),
+ SSA_NAME_RANGE_INFO (lhs)->min,
SSA_NAME_RANGE_INFO (lhs)->max);
maybe_set_nonzero_bits (bb, var);
}
@@ -9602,36 +9603,12 @@ vrp_finalize (void)
continue;
if ((TREE_CODE (vr_value[i]->min) == INTEGER_CST)
- && (TREE_CODE (vr_value[i]->max) == INTEGER_CST))
- {
- if (vr_value[i]->type == VR_RANGE)
- set_range_info (name,
- tree_to_double_int (vr_value[i]->min),
- tree_to_double_int (vr_value[i]->max));
- else if (vr_value[i]->type == VR_ANTI_RANGE)
- {
- /* VR_ANTI_RANGE ~[min, max] is encoded compactly as
- [max + 1, min - 1] without additional attributes.
- When min value > max value, we know that it is
- VR_ANTI_RANGE; it is VR_RANGE otherwise. */
-
- /* ~[0,0] anti-range is represented as
- range. */
- if (TYPE_UNSIGNED (TREE_TYPE (name))
- && integer_zerop (vr_value[i]->min)
- && integer_zerop (vr_value[i]->max))
- set_range_info (name,
- double_int_one,
- double_int::max_value
- (TYPE_PRECISION (TREE_TYPE (name)), true));
- else
- set_range_info (name,
- tree_to_double_int (vr_value[i]->max)
- + double_int_one,
- tree_to_double_int (vr_value[i]->min)
- - double_int_one);
- }
- }
+ && (TREE_CODE (vr_value[i]->max) == INTEGER_CST)
+ && (vr_value[i]->type == VR_RANGE
+ || vr_value[i]->type == VR_ANTI_RANGE))
+ set_range_info (name, vr_value[i]->type,
+ tree_to_double_int (vr_value[i]->min),
+ tree_to_double_int (vr_value[i]->max));
}
/* Free allocated memory. */