diff options
author | Richard Biener <rguenther@suse.de> | 2013-11-06 13:08:06 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-11-06 13:08:06 +0000 |
commit | 3f5c390ddd57a9407fce9b7a471d01972e916367 (patch) | |
tree | 053822df465eb3c1f6c53f1d007303a4f3ddaef0 /gcc/tree.c | |
parent | 9789a9127686e1d8d9e99a22bfaea4d2587d2bfd (diff) | |
download | gcc-3f5c390ddd57a9407fce9b7a471d01972e916367.zip gcc-3f5c390ddd57a9407fce9b7a471d01972e916367.tar.gz gcc-3f5c390ddd57a9407fce9b7a471d01972e916367.tar.bz2 |
tree.c (drop_tree_overflow): New function.
2013-11-06 Richard Biener <rguenther@suse.de>
* tree.c (drop_tree_overflow): New function.
* tree.h (drop_tree_overflow): Declare.
* gimplify.c (gimplify_expr): Drop TREE_OVERFLOW.
* tree-vrp.c (range_int_cst_singleton_p): Use
is_overflow_infinity instead of testing TREE_OVERFLOW.
(extract_range_from_assert): Likewise.
(zero_nonzero_bits_from_vr): Likewise.
(extract_range_basic): Likewise.
(register_new_assert_for): Use drop_tree_overflow.
(vrp_visit_phi_node): Likewise.
From-SVN: r204454
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -12542,4 +12542,23 @@ get_tree_code_name (enum tree_code code) return tree_code_name[code]; } +/* Drops the TREE_OVERFLOW flag from T. */ + +tree +drop_tree_overflow (tree t) +{ + gcc_checking_assert (TREE_OVERFLOW (t)); + + /* For tree codes with a sharing machinery re-build the result. */ + if (TREE_CODE (t) == INTEGER_CST) + return build_int_cst_wide (TREE_TYPE (t), + TREE_INT_CST_LOW (t), TREE_INT_CST_HIGH (t)); + + /* Otherwise, as all tcc_constants are possibly shared, copy the node + and drop the flag. */ + t = copy_node (t); + TREE_OVERFLOW (t) = 0; + return t; +} + #include "gt-tree.h" |