aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-const.c')
-rw-r--r--gcc/fortran/trans-const.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index a2c3e31..6c54e20 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "trans-const.h"
#include "trans-types.h"
#include "target-memory.h"
+#include "wide-int.h"
tree gfc_rank_cst[GFC_MAX_DIMENSIONS + 1];
@@ -145,8 +146,7 @@ gfc_conv_string_init (tree length, gfc_expr * expr)
gcc_assert (expr->expr_type == EXPR_CONSTANT);
gcc_assert (expr->ts.type == BT_CHARACTER);
- gcc_assert (INTEGER_CST_P (length));
- gcc_assert (TREE_INT_CST_HIGH (length) == 0);
+ gcc_assert (tree_fits_uhwi_p (length));
len = TREE_INT_CST_LOW (length);
slen = expr->value.character.length;
@@ -201,8 +201,8 @@ gfc_init_constants (void)
tree
gfc_conv_mpz_to_tree (mpz_t i, int kind)
{
- double_int val = mpz_get_double_int (gfc_get_int_type (kind), i, true);
- return double_int_to_tree (gfc_get_int_type (kind), val);
+ wide_int val = wi::from_mpz (gfc_get_int_type (kind), i, true);
+ return wide_int_to_tree (gfc_get_int_type (kind), val);
}
/* Converts a backend tree into a GMP integer. */
@@ -210,8 +210,7 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind)
void
gfc_conv_tree_to_mpz (mpz_t i, tree source)
{
- double_int val = tree_to_double_int (source);
- mpz_set_double_int (i, val, TYPE_UNSIGNED (TREE_TYPE (source)));
+ wi::to_mpz (source, i, TYPE_SIGN (TREE_TYPE (source)));
}
/* Converts a real constant into backend form. */