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.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 3202a59..68b8d59 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -81,7 +81,7 @@ gfc_build_string_const (int length, const char *s)
tree len;
str = build_string (length, s);
- len = build_int_2 (length, 0);
+ len = build_int_cst (NULL_TREE, length, 0);
TREE_TYPE (str) =
build_array_type (gfc_character1_type_node,
build_range_type (gfc_strlen_type_node,
@@ -145,10 +145,7 @@ gfc_init_constants (void)
int n;
for (n = 0; n <= GFC_MAX_DIMENSIONS; n++)
- {
- gfc_rank_cst[n] = build_int_2 (n, 0);
- TREE_TYPE (gfc_rank_cst[n]) = gfc_array_index_type;
- }
+ gfc_rank_cst[n] = build_int_cst (gfc_array_index_type, n, 0);
gfc_strconst_bounds = gfc_build_string_const (21, "Array bound mismatch");
@@ -182,8 +179,8 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind)
if (mpz_fits_slong_p (i))
{
val = mpz_get_si (i);
- res = build_int_2 (val, (val < 0) ? (HOST_WIDE_INT)-1 : 0);
- TREE_TYPE (res) = gfc_get_int_type (kind);
+ res = build_int_cst (gfc_get_int_type (kind),
+ val, (val < 0) ? (HOST_WIDE_INT)-1 : 0);
return (res);
}
@@ -220,8 +217,7 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind)
high = (high << 4) + (low >> (BITS_PER_HOST_WIDE_INT - 4));
low = (low << 4) + n;
}
- res = build_int_2 (low, high);
- TREE_TYPE (res) = gfc_get_int_type (kind);
+ res = build_int_cst (gfc_get_int_type (kind), low, high);
if (negate)
res = fold (build1 (NEGATE_EXPR, TREE_TYPE (res), res));
@@ -324,7 +320,7 @@ gfc_conv_constant_to_tree (gfc_expr * expr)
return gfc_conv_mpfr_to_tree (expr->value.real, expr->ts.kind);
case BT_LOGICAL:
- return build_int_2 (expr->value.logical, 0);
+ return build_int_cst (NULL_TREE, expr->value.logical, 0);
case BT_COMPLEX:
{