aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@gcc.gnu.org>2004-08-15 15:45:33 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-08-15 15:45:33 +0000
commit4a90aeeb51438af9f31cf57ccbba6fdd7c331398 (patch)
tree40077b7dd50d472ee732b6ecf6d2b305f7b6da58 /gcc/fortran
parent2a68a7deaea5b282ebc2a505a6c7af912e3387a5 (diff)
downloadgcc-4a90aeeb51438af9f31cf57ccbba6fdd7c331398.zip
gcc-4a90aeeb51438af9f31cf57ccbba6fdd7c331398.tar.gz
gcc-4a90aeeb51438af9f31cf57ccbba6fdd7c331398.tar.bz2
tree.h (build_int_cst): New.
.: * tree.h (build_int_cst): New. (build_int_2): Remove. * tree.c (build_int_2): Remove. (build_int_cst): New. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Use build_int_cst. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Use build_int_cst. * c-common.c (start_fname_decls, fix_string_type, c_common_nodes_and_builtins, c_init_attributes, shorten_compare): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. * convert.c (convert_to_pointer): Likewise. * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. * fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_end_case_type, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Use build_int_cst. ada: * cuintp.c (UI_To_gnu): Use build_int_cst.. * trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise. * utils.c (init_gigi_decls): Likewise. * utils2.c (build_call_raise): Likewise. cp: * call.c (convert_class_to_reference, build_user_type_conversion_1, convert_like_real, build_java_interface_fn_ref, build_special_member_call): Use build_int_cst. * class.c (build_vtbl_initializer): Likewise. * cp-gimplify.c (cp_gimplify_expr): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. * decl2.c (start_static_initialization_or_destruction, generate_ctor_or_dtor_function): Likewise. * except.c (build_throw): Likewise. * lex.c (cxx_init): Likewise. * mangle.c (write_integer_cst): Likewise. * rtti.c (build_headof, get_tinfo_decl_dynamic, build_dynamic_cast_1, ptr_initializer, ptm_initializer, get_pseudo_ti_init): Likewise. * search.c (get_dynamic_cast_base_type): Likewise. * tree.c (build_shared_int_cst): Likewise. fortran: * trans-array.c (gfc_trans_array_constructor_value): Use build_int_cst. * trans-const.c (gfc_build_string_const, gfc_init_constants, gfc_conv_mpz_to_tree, gfc_conv_constant_to_tree): Likewise. * trans-decl.c (gfc_get_symbol_decl): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_len, prepare_arg_info): Likewise. * trans-io.c (add_case, set_error_locus, build_dt, transfer_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause, gfc_trans_stop, gfc_trans_character_select): Likewise. * trans-types.c (gfc_init_types, gfc_get_dtype): Likewise. * trans.c (gfc_trans_runtime_check): Likewise. java: * boehm.c (get_boehm_type_descriptor): Use build_int_cst. * class.c (build_utf8_ref, build_static_field_ref, make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table): Likewise. * constants.c (get_tag_node, build_ref_from_constant_pool, build_constants_constructor): Likewise. * decl.c (java_init_decl_processing): Likewise. * expr.c (build_java_array_length_access, build_newarray, expand_java_multianewarray, expand_java_pushc, expand_iinc, build_java_binop, build_field_ref, expand_java_add_case, expand_java_call, build_known_method_ref, build_invokevirtual, build_invokeinterface, build_jni_stub): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Likewise. * jcf-parse.c (get_constant): Likewise. * lex.c (do_java_lex): Likewise. * parse.y (patch_binop, patch_unaryop, patch_cast, build_null_of_type, patch_newarray): Likewise. * resource.c (compile_resource_data): Likewise. * typeck.c (build_prim_array_type): Likewise. From-SVN: r86022
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog31
-rw-r--r--gcc/fortran/trans-array.c4
-rw-r--r--gcc/fortran/trans-const.c16
-rw-r--r--gcc/fortran/trans-decl.c2
-rw-r--r--gcc/fortran/trans-intrinsic.c8
-rw-r--r--gcc/fortran/trans-io.c14
-rw-r--r--gcc/fortran/trans-stmt.c14
-rw-r--r--gcc/fortran/trans-types.c15
-rw-r--r--gcc/fortran/trans.c2
9 files changed, 56 insertions, 50 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9bea25a..4602636 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,20 @@
+2004-08-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * trans-array.c (gfc_trans_array_constructor_value): Use
+ build_int_cst.
+ * trans-const.c (gfc_build_string_const,
+ gfc_init_constants, gfc_conv_mpz_to_tree,
+ gfc_conv_constant_to_tree): Likewise.
+ * trans-decl.c (gfc_get_symbol_decl): Likewise.
+ * trans-intrinsic.c (gfc_conv_intrinsic_ibits,
+ gfc_conv_intrinsic_len, prepare_arg_info): Likewise.
+ * trans-io.c (add_case, set_error_locus, build_dt,
+ transfer_expr): Likewise.
+ * trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause,
+ gfc_trans_stop, gfc_trans_character_select): Likewise.
+ * trans-types.c (gfc_init_types, gfc_get_dtype): Likewise.
+ * trans.c (gfc_trans_runtime_check): Likewise.
+
2004-08-14 Paul Brook <paul@codesourcery.com>
* trans-decl.c (gfc_build_function_decl): Remove dead code.
@@ -957,7 +974,7 @@
* symbol.c (gfc_add_common): Disable checks to work around other more
fundamental inadequacies.
-2004-05-22 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+2004-05-22 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
* trans-decl.c (gfc_get_extern_function_decl): Set DECL_IS_PURE
only for functions.
@@ -1165,7 +1182,7 @@
* decl.c (variable_decl): Always apply default initializer.
-2004-05-08 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+2004-05-08 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/15206
* trans-intrinsic.c (gfc_conv_intrinsic_rrspacing): Fixed to
@@ -1239,7 +1256,7 @@
Remove "set DEVELOPMENT".
(Compiling GFORTRAN): Remove.
-2004-05-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+2004-05-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
* array.c (match_subscript, match_array_ref): Add comments
explaining argument 'init'.
@@ -1249,20 +1266,20 @@
* primary.c (match_digits, match_integer_constant): Add comment
explaining signflag.
-2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/13940
* primary.c: Include system.h and flags.h, needed for pedantic.
(match_boz_constant): Allow "x" for hexadecimal constants, warn if
pedantic is set.
-2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/13940
* match.c (match_data_constant): Handle case where
gfc_find_symbol sets sym to NULL
-2004-04-28 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+2004-04-28 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
* Make-lang.in (f95-lang.o, trans-intrinsic.o): Add missing
dependency on mathbuiltins.def
@@ -1276,7 +1293,7 @@
* gfortranspec.c: Do not include multilib.h.
-2004-04-24 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+2004-04-24 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
* trans-intrinsic.c: Fix comment, this is not trans-expr.c. Add
2004 to copyright years.
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 46bf211..a6dea46 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -796,7 +796,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
p = p->next;
}
- bound = build_int_2 (n - 1, 0);
+ bound = build_int_cst (NULL_TREE, n - 1, 0);
/* Create an array type to hold them. */
tmptype = build_range_type (gfc_array_index_type,
gfc_index_zero_node, bound);
@@ -821,7 +821,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
init = gfc_build_addr_expr (NULL, init);
size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type));
- bound = build_int_2 (n * size, 0);
+ bound = build_int_cst (NULL_TREE, n * size, 0);
tmp = gfc_chainon_list (NULL_TREE, tmp);
tmp = gfc_chainon_list (tmp, init);
tmp = gfc_chainon_list (tmp, bound);
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:
{
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index e2707b4..ef802ec 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -798,7 +798,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
ASSIGN_ADDR can not be used. Equal -1 means that ASSIGN_ADDR is the
target label's address. Other value is the length of format string
and ASSIGN_ADDR is the address of format string. */
- DECL_INITIAL (length) = build_int_2 (-2, -1);
+ DECL_INITIAL (length) = build_int_cst (NULL_TREE, -2, -1);
}
if (sym->ts.type == BT_CHARACTER)
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index f83e1e1..c580cd4 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -1760,7 +1760,7 @@ gfc_conv_intrinsic_ibits (gfc_se * se, gfc_expr * expr)
arg2 = TREE_VALUE (arg2);
type = TREE_TYPE (arg);
- mask = build_int_2 (-1, ~(unsigned HOST_WIDE_INT) 0);
+ mask = build_int_cst (NULL_TREE, -1, ~(unsigned HOST_WIDE_INT) 0);
mask = build (LSHIFT_EXPR, type, mask, arg3);
mask = build1 (BIT_NOT_EXPR, type, mask);
@@ -1884,7 +1884,7 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc_expr * expr)
switch (arg->expr_type)
{
case EXPR_CONSTANT:
- len = build_int_2 (arg->value.character.length, 0);
+ len = build_int_cst (NULL_TREE, arg->value.character.length, 0);
break;
default:
@@ -2329,9 +2329,9 @@ void prepare_arg_info (gfc_se * se, gfc_expr * expr,
/* Caculate the numbers of bits of exponent, fraction and word */
n = gfc_validate_kind (a1->ts.type, a1->ts.kind);
- tmp = build_int_2 (gfc_real_kinds[n].digits - 1, 0);
+ tmp = build_int_cst (NULL_TREE, gfc_real_kinds[n].digits - 1, 0);
rcs->fdigits = convert (masktype, tmp);
- wbits = build_int_2 (TYPE_PRECISION (rcs->type) - 1, 0);
+ wbits = build_int_cst (NULL_TREE, TYPE_PRECISION (rcs->type) - 1, 0);
wbits = convert (masktype, wbits);
rcs->edigits = fold (build (MINUS_EXPR, masktype, wbits, tmp));
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index b01b8f6..8df23ed 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -450,7 +450,7 @@ add_case (int label_value, gfc_st_label * label, stmtblock_t * body)
if (label == NULL)
return; /* No label, no case */
- value = build_int_2 (label_value, 0);
+ value = build_int_cst (NULL_TREE, label_value, 0);
/* Make a backend label for this case. */
tmp = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
@@ -523,7 +523,7 @@ set_error_locus (stmtblock_t * block, locus * where)
gfc_add_modify_expr (block, locus_file, tmp);
line = where->lb->linenum;
- gfc_add_modify_expr (block, locus_line, build_int_2 (line, 0));
+ gfc_add_modify_expr (block, locus_line, build_int_cst (NULL_TREE, line, 0));
}
@@ -943,7 +943,7 @@ build_dt (tree * function, gfc_code * code)
args = gfc_chainon_list (NULL_TREE, se.expr);
args = gfc_chainon_list (args, se2.expr);
args = gfc_chainon_list (args, se2.string_length);
- arg2 = build_int_2 (ts_kind, 0);
+ arg2 = build_int_cst (NULL_TREE, ts_kind, 0);
args = gfc_chainon_list (args,arg2);
switch (ts_type)
{
@@ -1096,22 +1096,22 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
switch (ts->type)
{
case BT_INTEGER:
- arg2 = build_int_2 (kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind, 0);
function = iocall_x_integer;
break;
case BT_REAL:
- arg2 = build_int_2 (kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind, 0);
function = iocall_x_real;
break;
case BT_COMPLEX:
- arg2 = build_int_2 (kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind, 0);
function = iocall_x_complex;
break;
case BT_LOGICAL:
- arg2 = build_int_2 (kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind, 0);
function = iocall_x_logical;
break;
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 794e2fc..261bf77 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -113,7 +113,7 @@ gfc_trans_label_assign (gfc_code * code)
{
label_str = code->label->format->value.character.string;
label_len = code->label->format->value.character.length;
- len_tree = build_int_2 (label_len, 0);
+ len_tree = build_int_cst (NULL_TREE, label_len, 0);
label_tree = gfc_build_string_const (label_len + 1, label_str);
label_tree = gfc_build_addr_expr (pchar_type_node, label_tree);
}
@@ -279,8 +279,7 @@ gfc_trans_pause (gfc_code * code)
if (code->expr == NULL)
{
- tmp = build_int_2 (code->ext.stop_code, 0);
- TREE_TYPE (tmp) = gfc_int4_type_node;
+ tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code, 0);
args = gfc_chainon_list (NULL_TREE, tmp);
fndecl = gfor_fndecl_pause_numeric;
}
@@ -319,8 +318,7 @@ gfc_trans_stop (gfc_code * code)
if (code->expr == NULL)
{
- tmp = build_int_2 (code->ext.stop_code, 0);
- TREE_TYPE (tmp) = gfc_int4_type_node;
+ tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code, 0);
args = gfc_chainon_list (NULL_TREE, tmp);
fndecl = gfor_fndecl_stop_numeric;
}
@@ -1093,8 +1091,8 @@ gfc_trans_character_select (gfc_code *code)
init = tree_cons (NULL_TREE, tmp, init);
}
- type = build_array_type (select_struct,
- build_index_type (build_int_2(n - 1, 0)));
+ type = build_array_type (select_struct, build_index_type
+ (build_int_cst (NULL_TREE, n - 1, 0)));
init = build1 (CONSTRUCTOR, type, nreverse(init));
TREE_CONSTANT (init) = 1;
@@ -1112,7 +1110,7 @@ gfc_trans_character_select (gfc_code *code)
init = gfc_build_addr_expr (pvoid_type_node, init);
args = gfc_chainon_list (NULL_TREE, init);
- tmp = build_int_2 (n, 0);
+ tmp = build_int_cst (NULL_TREE, n, 0);
args = gfc_chainon_list (args, tmp);
tmp = gfc_build_addr_expr (pvoid_type_node, end_label);
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index f661976..b01298d 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -168,16 +168,13 @@ gfc_init_types (void)
hi = 0;
lo = (~(unsigned HOST_WIDE_INT) 0) >> (sizeof (HOST_WIDE_INT) * 8 - n);
}
- gfc_max_array_element_size = build_int_2 (lo, hi);
- TREE_TYPE (gfc_max_array_element_size) = long_unsigned_type_node;
+ gfc_max_array_element_size = build_int_cst (long_unsigned_type_node, lo, hi);
size_type_node = gfc_array_index_type;
boolean_type_node = gfc_get_logical_type (gfc_default_logical_kind ());
- boolean_true_node = build_int_2 (1, 0);
- TREE_TYPE (boolean_true_node) = boolean_type_node;
- boolean_false_node = build_int_2 (0, 0);
- TREE_TYPE (boolean_false_node) = boolean_type_node;
+ boolean_true_node = build_int_cst (boolean_type_node, 1, 0);
+ boolean_false_node = build_int_cst (boolean_type_node, 0, 0);
}
/* Get a type node for an integer kind */
@@ -600,13 +597,11 @@ gfc_get_dtype (tree type, int rank)
i += TREE_INT_CST_LOW (size) << GFC_DTYPE_SIZE_SHIFT;
}
- dtype = build_int_2 (i, 0);
- TREE_TYPE (dtype) = gfc_array_index_type;
+ dtype = build_int_cst (gfc_array_index_type, i, 0);
if (size && !INTEGER_CST_P (size))
{
- tmp = build_int_2 (GFC_DTYPE_SIZE_SHIFT, 0);
- TREE_TYPE (tmp) = gfc_array_index_type;
+ tmp = build_int_cst (gfc_array_index_type, GFC_DTYPE_SIZE_SHIFT, 0);
tmp = fold (build (LSHIFT_EXPR, gfc_array_index_type, size, tmp));
dtype = fold (build (PLUS_EXPR, gfc_array_index_type, tmp, dtype));
}
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 00215f6..052da55 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -365,7 +365,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
tmp = gfc_build_addr_expr (pchar_type_node, gfc_strconst_current_filename);
args = gfc_chainon_list (args, tmp);
- tmp = build_int_2 (input_line, 0);
+ tmp = build_int_cst (NULL_TREE, input_line, 0);
args = gfc_chainon_list (args, tmp);
tmp = gfc_build_function_call (gfor_fndecl_runtime_error, args);