aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 25756bbb9c9..609217b755f 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7866,7 +7866,10 @@ fold_unary (enum tree_code code, tree type, tree op0)
/* Convert (T)(x & c) into (T)x & (T)c, if c is an integer
constants (if x has signed type, the sign bit cannot be set
- in c). This folds extension into the BIT_AND_EXPR. */
+ in c). This folds extension into the BIT_AND_EXPR.
+ ??? We don't do it for BOOLEAN_TYPE or ENUMERAL_TYPE because they
+ very likely don't have maximal range for their precision and this
+ transformation effectively doesn't preserve non-maximal ranges. */
if (TREE_CODE (type) == INTEGER_TYPE
&& TREE_CODE (op0) == BIT_AND_EXPR
&& TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST)
@@ -14071,11 +14074,6 @@ tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p)
switch (TREE_CODE (t))
{
- case SSA_NAME:
- /* Query VRP to see if it has recorded any information about
- the range of this object. */
- return ssa_name_nonnegative_p (t);
-
case INTEGER_CST:
return tree_int_cst_sgn (t) >= 0;
@@ -14560,11 +14558,6 @@ tree_single_nonzero_warnv_p (tree t, bool *strict_overflow_p)
bool sub_strict_overflow_p;
switch (TREE_CODE (t))
{
- case SSA_NAME:
- /* Query VRP to see if it has recorded any information about
- the range of this object. */
- return ssa_name_nonzero_p (t);
-
case INTEGER_CST:
return !integer_zerop (t);