aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 43a72bc1b6a..0955cabc13d 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -975,6 +975,9 @@ copy_node_stat (tree node MEM_STAT_DECL)
SET_DECL_VALUE_EXPR (t, DECL_VALUE_EXPR (node));
DECL_HAS_VALUE_EXPR_P (t) = 1;
}
+ /* DECL_DEBUG_EXPR is copied explicitely by callers. */
+ if (TREE_CODE (node) == VAR_DECL)
+ DECL_HAS_DEBUG_EXPR_P (t) = 0;
if (TREE_CODE (node) == VAR_DECL && DECL_HAS_INIT_PRIORITY_P (node))
{
SET_DECL_INIT_PRIORITY (t, DECL_INIT_PRIORITY (node));
@@ -6648,8 +6651,6 @@ tree_int_cst_sgn (const_tree t)
unsigned int
tree_int_cst_min_precision (tree value, bool unsignedp)
{
- int log;
-
/* If the value is negative, compute its negative minus 1. The latter
adjustment is because the absolute value of the largest negative value
is one larger than the largest positive value. This is equivalent to
@@ -6659,14 +6660,14 @@ tree_int_cst_min_precision (tree value, bool unsignedp)
value = fold_build1 (BIT_NOT_EXPR, TREE_TYPE (value), value);
/* Return the number of bits needed, taking into account the fact
- that we need one more bit for a signed than unsigned type. */
+ that we need one more bit for a signed than unsigned type.
+ If value is 0 or -1, the minimum precision is 1 no matter
+ whether unsignedp is true or false. */
if (integer_zerop (value))
- log = 0;
+ return 1;
else
- log = tree_floor_log2 (value);
-
- return log + 1 + !unsignedp;
+ return tree_floor_log2 (value) + 1 + !unsignedp;
}
/* Compare two constructor-element-type constants. Return 1 if the lists