aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2014-05-06 16:25:05 +0000
committerMike Stump <mrs@gcc.gnu.org>2014-05-06 16:25:05 +0000
commit807e902eea17f3132488c256c963823976b2348c (patch)
treee5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc/ada/gcc-interface
parent6122336c832dc4dfedc49279549caddce86306ff (diff)
downloadgcc-807e902eea17f3132488c256c963823976b2348c.zip
gcc-807e902eea17f3132488c256c963823976b2348c.tar.gz
gcc-807e902eea17f3132488c256c963823976b2348c.tar.bz2
Merge in wide-int.
From-SVN: r210113
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/cuintp.c6
-rw-r--r--gcc/ada/gcc-interface/decl.c8
-rw-r--r--gcc/ada/gcc-interface/utils.c3
3 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ada/gcc-interface/cuintp.c b/gcc/ada/gcc-interface/cuintp.c
index c5736f5..1bf9c35 100644
--- a/gcc/ada/gcc-interface/cuintp.c
+++ b/gcc/ada/gcc-interface/cuintp.c
@@ -160,7 +160,11 @@ UI_From_gnu (tree Input)
in a signed 64-bit integer. */
if (tree_fits_shwi_p (Input))
return UI_From_Int (tree_to_shwi (Input));
- else if (TREE_INT_CST_HIGH (Input) < 0 && TYPE_UNSIGNED (gnu_type))
+
+ gcc_assert (TYPE_PRECISION (gnu_type) <= 64);
+ if (TYPE_UNSIGNED (gnu_type)
+ && TYPE_PRECISION (gnu_type) == 64
+ && wi::neg_p (Input, SIGNED))
return No_Uint;
#endif
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 73945f1..6d0b8b2 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1642,7 +1642,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
TYPE_PRECISION (gnu_type) = esize;
TYPE_UNSIGNED (gnu_type) = is_unsigned;
set_min_and_max_values_for_integral_type (gnu_type, esize,
- is_unsigned);
+ TYPE_SIGN (gnu_type));
process_attributes (&gnu_type, &attr_list, true, gnat_entity);
layout_type (gnu_type);
@@ -7521,11 +7521,9 @@ annotate_value (tree gnu_size)
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
{
tree op1 = TREE_OPERAND (gnu_size, 1);
- double_int signed_op1
- = tree_to_double_int (op1).sext (TYPE_PRECISION (sizetype));
- if (signed_op1.is_negative ())
+ if (wi::neg_p (op1))
{
- op1 = double_int_to_tree (sizetype, -signed_op1);
+ op1 = wide_int_to_tree (sizetype, wi::neg (op1));
pre_op1 = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
}
}
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index c81ab00..b9b9dc1 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -6187,8 +6187,7 @@ static bool
get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp)
{
/* Verify the arg number is a constant. */
- if (TREE_CODE (arg_num_expr) != INTEGER_CST
- || TREE_INT_CST_HIGH (arg_num_expr) != 0)
+ if (!tree_fits_uhwi_p (arg_num_expr))
return false;
*valp = TREE_INT_CST_LOW (arg_num_expr);