aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-02-21 02:28:03 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-02-21 02:28:03 +0000
commitc1a70a3c1e62543419433baf6b1f4c441ca2c63e (patch)
tree37f0f5ff5923633310a8dd5a55e1b5912dcbc05d /gcc/tree-vrp.c
parentf49712d83374cdb039e2dfa6e3197df7ebbfd23d (diff)
downloadgcc-c1a70a3c1e62543419433baf6b1f4c441ca2c63e.zip
gcc-c1a70a3c1e62543419433baf6b1f4c441ca2c63e.tar.gz
gcc-c1a70a3c1e62543419433baf6b1f4c441ca2c63e.tar.bz2
re PR tree-optimization/26361 (bootstrap failure on Alpha: xgcc runs out of memory compiling libiberty/md5.c)
PR tree-optimization/26361 * tree-vrp.c (extract_range_from_unary_expr): Handle NEGATE_EXPR of unsigned integer types. * gcc.dg/tree-ssa/vrp27.c: New test case. From-SVN: r111327
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index b6b6d40..911ccb2 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1790,6 +1790,24 @@ extract_range_from_unary_expr (value_range_t *vr, tree expr)
max = (vr0.min == TYPE_MIN_VALUE (TREE_TYPE (expr)) && !flag_wrapv)
? TYPE_MAX_VALUE (TREE_TYPE (expr))
: fold_unary_to_constant (code, TREE_TYPE (expr), vr0.min);
+
+ }
+ else if (code == NEGATE_EXPR
+ && TYPE_UNSIGNED (TREE_TYPE (expr)))
+ {
+ if (!range_includes_zero_p (&vr0))
+ {
+ max = fold_unary_to_constant (code, TREE_TYPE (expr), vr0.min);
+ min = fold_unary_to_constant (code, TREE_TYPE (expr), vr0.max);
+ }
+ else
+ {
+ if (range_is_null (&vr0))
+ set_value_range_to_null (vr, TREE_TYPE (expr));
+ else
+ set_value_range_to_varying (vr);
+ return;
+ }
}
else if (code == ABS_EXPR
&& !TYPE_UNSIGNED (TREE_TYPE (expr)))