aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-08-25 09:52:54 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-08-25 09:52:54 +0000
commit7d60be94d610cd5f18bc2ae64e4e97f210c8538b (patch)
treeb5d8f16132872f7a863ddce55007c0a82239369a /gcc/fortran
parent5b292a4b0568b7b360fb092893496211f3a51126 (diff)
downloadgcc-7d60be94d610cd5f18bc2ae64e4e97f210c8538b.zip
gcc-7d60be94d610cd5f18bc2ae64e4e97f210c8538b.tar.gz
gcc-7d60be94d610cd5f18bc2ae64e4e97f210c8538b.tar.bz2
tree.h (build_int_cst): New, sign extended constant.
* tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * 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_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): 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_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, 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, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, 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. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * 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/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): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog19
-rw-r--r--gcc/fortran/trans-array.c4
-rw-r--r--gcc/fortran/trans-const.c6
-rw-r--r--gcc/fortran/trans-decl.c6
-rw-r--r--gcc/fortran/trans-intrinsic.c8
-rw-r--r--gcc/fortran/trans-io.c14
-rw-r--r--gcc/fortran/trans-stmt.c10
-rw-r--r--gcc/fortran/trans-types.c11
-rw-r--r--gcc/fortran/trans.c2
9 files changed, 49 insertions, 31 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d4d9d00..0d2f8b6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,20 @@
+2004-08-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * trans-array.c (gfc_trans_array_constructor_value): Adjust
+ build_int_cst calls.
+ * 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, build_entry_thunks,
+ gfc_trans_entry_master_switch): Likewise.
+ * trans-intrinsic.c (gfc_conv_intrinsic_ibits,
+ gfc_conv_intrinsic_len, prepare_arg_info): Likewise.
+ * trans-io.c (add_case, set_error_locus,
+ transfer_namelist_element, 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-24 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* trans-decl.c, trans-types.c: Add and remove blank lines as
@@ -22,7 +39,7 @@
2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
- * fortran/f95-lang.c (gfc_init_decl_processing): Adjust
+ * f95-lang.c (gfc_init_decl_processing): Adjust
build_common_tree_nodes call.
2004-08-24 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index e6c4600..f79ab1e 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_cst (NULL_TREE, n - 1, 0);
+ bound = build_int_cst (NULL_TREE, n - 1);
/* 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_cst (NULL_TREE, n * size, 0);
+ bound = build_int_cst (NULL_TREE, n * size);
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 110c0db..2f485a7 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -82,7 +82,7 @@ gfc_build_string_const (int length, const char *s)
tree len;
str = build_string (length, s);
- len = build_int_cst (NULL_TREE, length, 0);
+ len = build_int_cst (NULL_TREE, length);
TREE_TYPE (str) =
build_array_type (gfc_character1_type_node,
build_range_type (gfc_strlen_type_node,
@@ -146,7 +146,7 @@ gfc_init_constants (void)
int n;
for (n = 0; n <= GFC_MAX_DIMENSIONS; n++)
- gfc_rank_cst[n] = build_int_cst (gfc_array_index_type, n, 0);
+ gfc_rank_cst[n] = build_int_cst (gfc_array_index_type, n);
gfc_strconst_bounds = gfc_build_string_const (21, "Array bound mismatch");
@@ -315,7 +315,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_cst (NULL_TREE, expr->value.logical, 0);
+ return build_int_cst (NULL_TREE, expr->value.logical);
case BT_COMPLEX:
{
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 76618b2..7188905 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -790,7 +790,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_cst (NULL_TREE, -2, -1);
+ DECL_INITIAL (length) = build_int_cst (NULL_TREE, -2);
}
if (sym->ts.type == BT_CHARACTER)
@@ -1346,7 +1346,7 @@ build_entry_thunks (gfc_namespace * ns)
gfc_start_block (&body);
/* Pass extra parameter identifying this entry point. */
- tmp = build_int_cst (gfc_array_index_type, el->id, 0);
+ tmp = build_int_cst (gfc_array_index_type, el->id);
args = tree_cons (NULL_TREE, tmp, NULL_TREE);
string_args = NULL_TREE;
@@ -2113,7 +2113,7 @@ gfc_trans_entry_master_switch (gfc_entry_list * el)
/* Add the case label. */
label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
DECL_CONTEXT (label) = current_function_decl;
- val = build_int_cst (gfc_array_index_type, el->id, 0);
+ val = build_int_cst (gfc_array_index_type, el->id);
tmp = build_v (CASE_LABEL_EXPR, val, NULL_TREE, label);
gfc_add_expr_to_block (&block, tmp);
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 1a8a8b6..cfe3051 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_cst (NULL_TREE, -1, ~(unsigned HOST_WIDE_INT) 0);
+ mask = build_int_cst (NULL_TREE, -1);
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_cst (NULL_TREE, arg->value.character.length, 0);
+ len = build_int_cst (NULL_TREE, arg->value.character.length);
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_cst (NULL_TREE, gfc_real_kinds[n].digits - 1, 0);
+ tmp = build_int_cst (NULL_TREE, gfc_real_kinds[n].digits - 1);
rcs->fdigits = convert (masktype, tmp);
- wbits = build_int_cst (NULL_TREE, TYPE_PRECISION (rcs->type) - 1, 0);
+ wbits = build_int_cst (NULL_TREE, TYPE_PRECISION (rcs->type) - 1);
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 63d5618..3d04332 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -451,7 +451,7 @@ add_case (int label_value, gfc_st_label * label, stmtblock_t * body)
if (label == NULL)
return; /* No label, no case */
- value = build_int_cst (NULL_TREE, label_value, 0);
+ value = build_int_cst (NULL_TREE, label_value);
/* Make a backend label for this case. */
tmp = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
@@ -524,7 +524,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_cst (NULL_TREE, line, 0));
+ gfc_add_modify_expr (block, locus_line, build_int_cst (NULL_TREE, line));
}
@@ -896,7 +896,7 @@ transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_exp
args = gfc_chainon_list (NULL_TREE, addr_expr);
args = gfc_chainon_list (args, string);
args = gfc_chainon_list (args, string_length);
- arg2 = build_int_cst (gfc_array_index_type, ts->kind, 0);
+ arg2 = build_int_cst (gfc_array_index_type, ts->kind);
args = gfc_chainon_list (args,arg2);
switch (ts->type)
@@ -1152,22 +1152,22 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
switch (ts->type)
{
case BT_INTEGER:
- arg2 = build_int_cst (NULL_TREE, kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind);
function = iocall_x_integer;
break;
case BT_REAL:
- arg2 = build_int_cst (NULL_TREE, kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind);
function = iocall_x_real;
break;
case BT_COMPLEX:
- arg2 = build_int_cst (NULL_TREE, kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind);
function = iocall_x_complex;
break;
case BT_LOGICAL:
- arg2 = build_int_cst (NULL_TREE, kind, 0);
+ arg2 = build_int_cst (NULL_TREE, kind);
function = iocall_x_logical;
break;
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index dbe4422..3b89107 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_cst (NULL_TREE, label_len, 0);
+ len_tree = build_int_cst (NULL_TREE, label_len);
label_tree = gfc_build_string_const (label_len + 1, label_str);
label_tree = gfc_build_addr_expr (pchar_type_node, label_tree);
}
@@ -287,7 +287,7 @@ gfc_trans_pause (gfc_code * code)
if (code->expr == NULL)
{
- tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code, 0);
+ tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code);
args = gfc_chainon_list (NULL_TREE, tmp);
fndecl = gfor_fndecl_pause_numeric;
}
@@ -326,7 +326,7 @@ gfc_trans_stop (gfc_code * code)
if (code->expr == NULL)
{
- tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code, 0);
+ tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code);
args = gfc_chainon_list (NULL_TREE, tmp);
fndecl = gfor_fndecl_stop_numeric;
}
@@ -1100,7 +1100,7 @@ gfc_trans_character_select (gfc_code *code)
}
type = build_array_type (select_struct, build_index_type
- (build_int_cst (NULL_TREE, n - 1, 0)));
+ (build_int_cst (NULL_TREE, n - 1)));
init = build1 (CONSTRUCTOR, type, nreverse(init));
TREE_CONSTANT (init) = 1;
@@ -1118,7 +1118,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_cst (NULL_TREE, n, 0);
+ tmp = build_int_cst (NULL_TREE, n);
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 f96dc28..6f96315 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -168,13 +168,14 @@ 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_cst (long_unsigned_type_node, lo, hi);
+ gfc_max_array_element_size
+ = build_int_cst_wide (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_cst (boolean_type_node, 1, 0);
- boolean_false_node = build_int_cst (boolean_type_node, 0, 0);
+ boolean_true_node = build_int_cst (boolean_type_node, 1);
+ boolean_false_node = build_int_cst (boolean_type_node, 0);
}
/* Get a type node for an integer kind. */
@@ -597,11 +598,11 @@ gfc_get_dtype (tree type, int rank)
i += TREE_INT_CST_LOW (size) << GFC_DTYPE_SIZE_SHIFT;
}
- dtype = build_int_cst (gfc_array_index_type, i, 0);
+ dtype = build_int_cst (gfc_array_index_type, i);
if (size && !INTEGER_CST_P (size))
{
- tmp = build_int_cst (gfc_array_index_type, GFC_DTYPE_SIZE_SHIFT, 0);
+ tmp = build_int_cst (gfc_array_index_type, GFC_DTYPE_SIZE_SHIFT);
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 1ac8931..16ef85c 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_cst (NULL_TREE, input_line, 0);
+ tmp = build_int_cst (NULL_TREE, input_line);
args = gfc_chainon_list (args, tmp);
tmp = gfc_build_function_call (gfor_fndecl_runtime_error, args);