aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2010-05-20 00:09:57 +0400
committerAnatoly Sokolov <aesok@gcc.gnu.org>2010-05-20 00:09:57 +0400
commit1961ffb8cd83ccb0f91ce9b3015bb3290f48b04b (patch)
tree89268be053049f4ffb484bf22fb0818f0c2db8b7 /gcc
parent9908949ca643e02d6a07fef3742d50f389a80def (diff)
downloadgcc-1961ffb8cd83ccb0f91ce9b3015bb3290f48b04b.zip
gcc-1961ffb8cd83ccb0f91ce9b3015bb3290f48b04b.tar.gz
gcc-1961ffb8cd83ccb0f91ce9b3015bb3290f48b04b.tar.bz2
double-int.h (double_int_ior): New function.
* double-int.h (double_int_ior): New function. * tree.h (build_int_cst_wide_type): Remove. * tree.c (build_int_cst_wide_type): Remove. * fold-const.c (native_interpret_int): Use double_int_to_tree instead of build_int_cst_wide_type. * stor-layout.c (set_sizetype): (Ditto.). * dojump.c (do_jump): Use build_int_cstu instead of build_int_cst_wide_type. /java * jcf-parse.c (get_constant): Use double_int_to_tree instead of build_int_cst_wide_type. From-SVN: r159595
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/dojump.c2
-rw-r--r--gcc/double-int.h13
-rw-r--r--gcc/fold-const.c13
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/jcf-parse.c19
-rw-r--r--gcc/stor-layout.c4
-rw-r--r--gcc/tree.c11
-rw-r--r--gcc/tree.h2
9 files changed, 48 insertions, 32 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aaaa6cb..e215a91 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2010-05-19 Anatoly Sokolov <aesok@post.ru>
+
+ * double-int.h (double_int_ior): New function.
+ * tree.h (build_int_cst_wide_type): Remove.
+ * tree.c (build_int_cst_wide_type): Remove.
+ * fold-const.c (native_interpret_int): Use double_int_to_tree instead
+ of build_int_cst_wide_type.
+ * stor-layout.c (set_sizetype): (Ditto.).
+ * dojump.c (do_jump): Use build_int_cstu instead of
+ build_int_cst_wide_type.
+
2010-05-19 Eric Botcazou <ebotcazou@adacore.com>
* langhooks.h (struct lang_hooks): Add new field deep_unsharing.
diff --git a/gcc/dojump.c b/gcc/dojump.c
index d4ce6cf..0ebf932 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -542,7 +542,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label, int prob)
unsigned HOST_WIDE_INT mask
= (unsigned HOST_WIDE_INT) 1 << TREE_INT_CST_LOW (shift);
do_jump (build2 (BIT_AND_EXPR, argtype, arg,
- build_int_cst_wide_type (argtype, mask, 0)),
+ build_int_cstu (argtype, mask)),
clr_label, set_label, setclr_prob);
break;
}
diff --git a/gcc/double-int.h b/gcc/double-int.h
index 65d25ef..370f619 100644
--- a/gcc/double-int.h
+++ b/gcc/double-int.h
@@ -126,6 +126,9 @@ double_int double_int_udivmod (double_int, double_int, unsigned, double_int *);
double_int double_int_setbit (double_int, unsigned);
/* Logical operations. */
+
+/* Returns ~A. */
+
static inline double_int
double_int_not (double_int a)
{
@@ -134,6 +137,16 @@ double_int_not (double_int a)
return a;
}
+/* Returns A | B. */
+
+static inline double_int
+double_int_ior (double_int a, double_int b)
+{
+ a.low |= b.low;
+ a.high |= b.high;
+ return a;
+}
+
/* Shift operations. */
double_int double_int_lshift (double_int, HOST_WIDE_INT, unsigned int, bool);
double_int double_int_rshift (double_int, HOST_WIDE_INT, unsigned int, bool);
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 17a7536..e92a674 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7408,13 +7408,14 @@ native_interpret_int (tree type, const unsigned char *ptr, int len)
int total_bytes = GET_MODE_SIZE (TYPE_MODE (type));
int byte, offset, word, words;
unsigned char value;
- unsigned int HOST_WIDE_INT lo = 0;
- HOST_WIDE_INT hi = 0;
+ double_int result;
if (total_bytes > len)
return NULL_TREE;
if (total_bytes * BITS_PER_UNIT > 2 * HOST_BITS_PER_WIDE_INT)
return NULL_TREE;
+
+ result = double_int_zero;
words = total_bytes / UNITS_PER_WORD;
for (byte = 0; byte < total_bytes; byte++)
@@ -7436,13 +7437,13 @@ native_interpret_int (tree type, const unsigned char *ptr, int len)
value = ptr[offset];
if (bitpos < HOST_BITS_PER_WIDE_INT)
- lo |= (unsigned HOST_WIDE_INT) value << bitpos;
+ result.low |= (unsigned HOST_WIDE_INT) value << bitpos;
else
- hi |= (unsigned HOST_WIDE_INT) value
- << (bitpos - HOST_BITS_PER_WIDE_INT);
+ result.high |= (unsigned HOST_WIDE_INT) value
+ << (bitpos - HOST_BITS_PER_WIDE_INT);
}
- return build_int_cst_wide_type (type, lo, hi);
+ return double_int_to_tree (type, result);
}
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index c26e950..9a68dcd 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-19 Anatoly Sokolov <aesok@post.ru>
+
+ * jcf-parse.c (get_constant): Use double_int_to_tree instead of
+ build_int_cst_wide_type.
+
2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
* expr.c (pop_arguments): Fix use of undeclared variable.
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 2fe97bc..4768c71 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -1,6 +1,6 @@
/* Parser for Java(TM) .class files.
Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -1040,14 +1040,15 @@ get_constant (JCF *jcf, int index)
}
case CONSTANT_Long:
{
- unsigned HOST_WIDE_INT num = JPOOL_UINT (jcf, index);
- unsigned HOST_WIDE_INT lo;
- HOST_WIDE_INT hi;
-
- lshift_double (num, 0, 32, 64, &lo, &hi, 0);
- num = JPOOL_UINT (jcf, index+1);
- add_double (lo, hi, num, 0, &lo, &hi);
- value = build_int_cst_wide_type (long_type_node, lo, hi);
+ unsigned HOST_WIDE_INT num;
+ double_int val;
+
+ num = JPOOL_UINT (jcf, index);
+ val = double_int_lshift (uhwi_to_double_int (num), 32, 64, false);
+ num = JPOOL_UINT (jcf, index + 1);
+ val = double_int_ior (val, uhwi_to_double_int (num));
+
+ value = double_int_to_tree (long_type_node, val);
break;
}
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 20b03a8..57287a4 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -2275,9 +2275,7 @@ set_sizetype (tree type)
sign-extended in a way consistent with force_fit_type. */
max = TYPE_MAX_VALUE (sizetype);
TYPE_MAX_VALUE (sizetype)
- = build_int_cst_wide_type (sizetype,
- TREE_INT_CST_LOW (max),
- TREE_INT_CST_HIGH (max));
+ = double_int_to_tree (sizetype, tree_to_double_int (max));
t = make_node (INTEGER_TYPE);
TYPE_NAME (t) = get_identifier ("bit_size_type");
diff --git a/gcc/tree.c b/gcc/tree.c
index fbf24b1..8873266 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1063,17 +1063,6 @@ build_int_cst_type (tree type, HOST_WIDE_INT low)
return build_int_cst_wide (type, low1, hi);
}
-/* Create an INT_CST node of TYPE and value HI:LOW. The value is truncated
- and sign extended according to the value range of TYPE. */
-
-tree
-build_int_cst_wide_type (tree type,
- unsigned HOST_WIDE_INT low, HOST_WIDE_INT high)
-{
- fit_double_type (low, high, &low, &high, type);
- return build_int_cst_wide (type, low, high);
-}
-
/* Constructs tree in type TYPE from with value given by CST. Signedness
of CST is assumed to be the same as the signedness of TYPE. */
diff --git a/gcc/tree.h b/gcc/tree.h
index e2f54a3..8d7ab6d 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4012,8 +4012,6 @@ build_int_cstu (tree type, unsigned HOST_WIDE_INT cst)
extern tree build_int_cst (tree, HOST_WIDE_INT);
extern tree build_int_cst_type (tree, HOST_WIDE_INT);
extern tree build_int_cst_wide (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
-extern tree build_int_cst_wide_type (tree,
- unsigned HOST_WIDE_INT, HOST_WIDE_INT);
extern tree build_vector (tree, tree);
extern tree build_vector_from_ctor (tree, VEC(constructor_elt,gc) *);
extern tree build_constructor (tree, VEC(constructor_elt,gc) *);