diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-08-15 15:45:33 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-08-15 15:45:33 +0000 |
commit | 4a90aeeb51438af9f31cf57ccbba6fdd7c331398 (patch) | |
tree | 40077b7dd50d472ee732b6ecf6d2b305f7b6da58 /gcc/expmed.c | |
parent | 2a68a7deaea5b282ebc2a505a6c7af912e3387a5 (diff) | |
download | gcc-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/expmed.c')
-rw-r--r-- | gcc/expmed.c | 205 |
1 files changed, 126 insertions, 79 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 7ee5964..75427e1 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -899,7 +899,8 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset, NULL_RTX, 1, OPTAB_LIB_WIDEN); if (bitpos > 0) value = expand_shift (LSHIFT_EXPR, mode, value, - build_int_2 (bitpos, 0), NULL_RTX, 1); + build_int_cst (NULL_TREE, + bitpos, 0), NULL_RTX, 1); } /* Now clear the chosen bits in OP0, @@ -1327,10 +1328,14 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, /* Signed bit field: sign-extend with two arithmetic shifts. */ target = expand_shift (LSHIFT_EXPR, mode, target, - build_int_2 (GET_MODE_BITSIZE (mode) - bitsize, 0), + build_int_cst (NULL_TREE, + GET_MODE_BITSIZE (mode) - bitsize, + 0), NULL_RTX, 0); return expand_shift (RSHIFT_EXPR, mode, target, - build_int_2 (GET_MODE_BITSIZE (mode) - bitsize, 0), + build_int_cst (NULL_TREE, + GET_MODE_BITSIZE (mode) - bitsize, + 0), NULL_RTX, 0); } @@ -1735,7 +1740,7 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, { /* If the field does not already start at the lsb, shift it so it does. */ - tree amount = build_int_2 (bitpos, 0); + tree amount = build_int_cst (NULL_TREE, bitpos, 0); /* Maybe propagate the target for the shift. */ /* But not if we will return it--could confuse integrate.c. */ rtx subtarget = (target != 0 && REG_P (target) ? target : 0); @@ -1775,14 +1780,16 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, if (GET_MODE_BITSIZE (mode) != (bitsize + bitpos)) { tree amount - = build_int_2 (GET_MODE_BITSIZE (mode) - (bitsize + bitpos), 0); + = build_int_cst (NULL_TREE, + GET_MODE_BITSIZE (mode) - (bitsize + bitpos), 0); /* Maybe propagate the target for the shift. */ rtx subtarget = (target != 0 && REG_P (target) ? target : 0); op0 = expand_shift (LSHIFT_EXPR, mode, op0, amount, subtarget, 1); } return expand_shift (RSHIFT_EXPR, mode, op0, - build_int_2 (GET_MODE_BITSIZE (mode) - bitsize, 0), + build_int_cst (NULL_TREE, + GET_MODE_BITSIZE (mode) - bitsize, 0), target, 0); } @@ -1930,13 +1937,15 @@ extract_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize, { if (bitsize != bitsdone) part = expand_shift (LSHIFT_EXPR, word_mode, part, - build_int_2 (bitsize - bitsdone, 0), 0, 1); + build_int_cst (NULL_TREE, + bitsize - bitsdone, 0), 0, 1); } else { if (bitsdone != thissize) part = expand_shift (LSHIFT_EXPR, word_mode, part, - build_int_2 (bitsdone - thissize, 0), 0, 1); + build_int_cst (NULL_TREE, + bitsdone - thissize, 0), 0, 1); } if (first) @@ -1955,10 +1964,12 @@ extract_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize, return result; /* Signed bit field: sign-extend with two arithmetic shifts. */ result = expand_shift (LSHIFT_EXPR, word_mode, result, - build_int_2 (BITS_PER_WORD - bitsize, 0), + build_int_cst (NULL_TREE, + BITS_PER_WORD - bitsize, 0), NULL_RTX, 0); return expand_shift (RSHIFT_EXPR, word_mode, result, - build_int_2 (BITS_PER_WORD - bitsize, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, + BITS_PER_WORD - bitsize, 0), NULL_RTX, 0); } /* Add INC into TARGET. */ @@ -2075,10 +2086,9 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, tree type = TREE_TYPE (amount); tree new_amount = make_tree (type, op1); tree other_amount - = fold (build2 (MINUS_EXPR, type, - convert (type, - build_int_2 (GET_MODE_BITSIZE (mode), - 0)), + = fold (build2 (MINUS_EXPR, type, convert + (type, build_int_cst + (NULL_TREE, GET_MODE_BITSIZE (mode), 0)), amount)); shifted = force_reg (mode, shifted); @@ -2549,13 +2559,15 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, { case alg_shift: accum = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_2 (log, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, log, 0), + NULL_RTX, 0); val_so_far <<= log; break; case alg_add_t_m2: tem = expand_shift (LSHIFT_EXPR, mode, op0, - build_int_2 (log, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, log, 0), + NULL_RTX, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, tem), add_target ? add_target : accum_target); val_so_far += (HOST_WIDE_INT) 1 << log; @@ -2563,7 +2575,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_sub_t_m2: tem = expand_shift (LSHIFT_EXPR, mode, op0, - build_int_2 (log, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, log, 0), + NULL_RTX, 0); accum = force_operand (gen_rtx_MINUS (mode, accum, tem), add_target ? add_target : accum_target); val_so_far -= (HOST_WIDE_INT) 1 << log; @@ -2571,7 +2584,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_add_t2_m: accum = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_2 (log, 0), shift_subtarget, + build_int_cst (NULL_TREE, log, 0), + shift_subtarget, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, op0), add_target ? add_target : accum_target); @@ -2580,7 +2594,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_sub_t2_m: accum = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_2 (log, 0), shift_subtarget, 0); + build_int_cst (NULL_TREE, log, 0), + shift_subtarget, 0); accum = force_operand (gen_rtx_MINUS (mode, accum, op0), add_target ? add_target : accum_target); val_so_far = (val_so_far << log) - 1; @@ -2588,7 +2603,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_add_factor: tem = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_2 (log, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, log, 0), + NULL_RTX, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, tem), add_target ? add_target : accum_target); val_so_far += val_so_far << log; @@ -2596,7 +2612,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_sub_factor: tem = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_2 (log, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, log, 0), + NULL_RTX, 0); accum = force_operand (gen_rtx_MINUS (mode, tem, accum), (add_target ? add_target : preserve ? 0 : tem)); @@ -2891,7 +2908,8 @@ expand_mult_highpart_adjust (enum machine_mode mode, rtx adj_operand, rtx op0, enum rtx_code adj_code = unsignedp ? PLUS : MINUS; tem = expand_shift (RSHIFT_EXPR, mode, op0, - build_int_2 (GET_MODE_BITSIZE (mode) - 1, 0), + build_int_cst (NULL_TREE, + GET_MODE_BITSIZE (mode) - 1, 0), NULL_RTX, 0); tem = expand_and (mode, tem, op1, NULL_RTX); adj_operand @@ -2899,7 +2917,8 @@ expand_mult_highpart_adjust (enum machine_mode mode, rtx adj_operand, rtx op0, adj_operand); tem = expand_shift (RSHIFT_EXPR, mode, op1, - build_int_2 (GET_MODE_BITSIZE (mode) - 1, 0), + build_int_cst (NULL_TREE, + GET_MODE_BITSIZE (mode) - 1, 0), NULL_RTX, 0); tem = expand_and (mode, tem, op0, NULL_RTX); target = force_operand (gen_rtx_fmt_ee (adj_code, mode, adj_operand, tem), @@ -2920,7 +2939,8 @@ extract_high_half (enum machine_mode mode, rtx op) wider_mode = GET_MODE_WIDER_MODE (mode); op = expand_shift (RSHIFT_EXPR, wider_mode, op, - build_int_2 (GET_MODE_BITSIZE (mode), 0), 0, 1); + build_int_cst (NULL_TREE, + GET_MODE_BITSIZE (mode), 0), 0, 1); return convert_modes (mode, wider_mode, op, 0); } @@ -3183,7 +3203,7 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) int logd; logd = floor_log2 (d); - shift = build_int_2 (logd, 0); + shift = build_int_cst (NULL_TREE, logd, 0); if (d == 2 && BRANCH_COST >= 1) { @@ -3230,7 +3250,8 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) NULL_RTX, 0, OPTAB_LIB_WIDEN); else temp = expand_shift (RSHIFT_EXPR, mode, temp, - build_int_2 (ushift, 0), NULL_RTX, 1); + build_int_cst (NULL_TREE, ushift, 0), + NULL_RTX, 1); temp = expand_binop (mode, add_optab, temp, op0, NULL_RTX, 0, OPTAB_LIB_WIDEN); return expand_shift (RSHIFT_EXPR, mode, temp, shift, NULL_RTX, 0); @@ -3506,7 +3527,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, return gen_lowpart (mode, remainder); } quotient = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (pre_shift, 0), + build_int_cst (NULL_TREE, + pre_shift, 0), tquotient, 1); } else if (size <= HOST_BITS_PER_WIDE_INT) @@ -3562,15 +3584,18 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, t2 = force_operand (gen_rtx_MINUS (compute_mode, op0, t1), NULL_RTX); - t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_2 (1, 0), NULL_RTX,1); + t3 = expand_shift + (RSHIFT_EXPR, compute_mode, t2, + build_int_cst (NULL_TREE, 1, 0), + NULL_RTX,1); t4 = force_operand (gen_rtx_PLUS (compute_mode, t1, t3), NULL_RTX); - quotient - = expand_shift (RSHIFT_EXPR, compute_mode, t4, - build_int_2 (post_shift - 1, 0), - tquotient, 1); + quotient = expand_shift + (RSHIFT_EXPR, compute_mode, t4, + build_int_cst (NULL_TREE, + post_shift - 1, 0), + tquotient, 1); } else { @@ -3580,9 +3605,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, || post_shift >= BITS_PER_WORD) goto fail1; - t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (pre_shift, 0), - NULL_RTX, 1); + t1 = expand_shift + (RSHIFT_EXPR, compute_mode, op0, + build_int_cst (NULL_TREE, pre_shift, 0), + NULL_RTX, 1); extra_cost = (shift_cost[compute_mode][pre_shift] + shift_cost[compute_mode][post_shift]); @@ -3591,10 +3617,11 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, max_cost - extra_cost); if (t2 == 0) goto fail1; - quotient - = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_2 (post_shift, 0), - tquotient, 1); + quotient = expand_shift + (RSHIFT_EXPR, compute_mode, t2, + build_int_cst (NULL_TREE, + post_shift, 0), + tquotient, 1); } } } @@ -3700,10 +3727,14 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, max_cost - extra_cost); if (t1 == 0) goto fail1; - t2 = expand_shift (RSHIFT_EXPR, compute_mode, t1, - build_int_2 (post_shift, 0), NULL_RTX, 0); - t3 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (size - 1, 0), NULL_RTX, 0); + t2 = expand_shift + (RSHIFT_EXPR, compute_mode, t1, + build_int_cst (NULL_TREE, post_shift, 0), + NULL_RTX, 0); + t3 = expand_shift + (RSHIFT_EXPR, compute_mode, op0, + build_int_cst (NULL_TREE, size - 1, 0), + NULL_RTX, 0); if (d < 0) quotient = force_operand (gen_rtx_MINUS (compute_mode, @@ -3735,12 +3766,14 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, t2 = force_operand (gen_rtx_PLUS (compute_mode, t1, op0), NULL_RTX); - t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_2 (post_shift, 0), - NULL_RTX, 0); - t4 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (size - 1, 0), - NULL_RTX, 0); + t3 = expand_shift + (RSHIFT_EXPR, compute_mode, t2, + build_int_cst (NULL_TREE, post_shift, 0), + NULL_RTX, 0); + t4 = expand_shift + (RSHIFT_EXPR, compute_mode, op0, + build_int_cst (NULL_TREE, size - 1, 0), + NULL_RTX, 0); if (d < 0) quotient = force_operand (gen_rtx_MINUS (compute_mode, @@ -3794,9 +3827,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, if (remainder) return gen_lowpart (mode, remainder); } - quotient = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (pre_shift, 0), - tquotient, 0); + quotient = expand_shift + (RSHIFT_EXPR, compute_mode, op0, + build_int_cst (NULL_TREE, pre_shift, 0), + tquotient, 0); } else { @@ -3810,9 +3844,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, if (post_shift < BITS_PER_WORD && size - 1 < BITS_PER_WORD) { - t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (size - 1, 0), - NULL_RTX, 0); + t1 = expand_shift + (RSHIFT_EXPR, compute_mode, op0, + build_int_cst (NULL_TREE, size - 1, 0), + NULL_RTX, 0); t2 = expand_binop (compute_mode, xor_optab, op0, t1, NULL_RTX, 0, OPTAB_WIDEN); extra_cost = (shift_cost[compute_mode][post_shift] @@ -3823,9 +3858,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, max_cost - extra_cost); if (t3 != 0) { - t4 = expand_shift (RSHIFT_EXPR, compute_mode, t3, - build_int_2 (post_shift, 0), - NULL_RTX, 1); + t4 = expand_shift + (RSHIFT_EXPR, compute_mode, t3, + build_int_cst (NULL_TREE, post_shift, 0), + NULL_RTX, 1); quotient = expand_binop (compute_mode, xor_optab, t4, t1, tquotient, 0, OPTAB_WIDEN); @@ -3840,8 +3876,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, op0, constm1_rtx), NULL_RTX); t2 = expand_binop (compute_mode, ior_optab, op0, t1, NULL_RTX, 0, OPTAB_WIDEN); - nsign = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_2 (size - 1, 0), NULL_RTX, 0); + nsign = expand_shift + (RSHIFT_EXPR, compute_mode, t2, + build_int_cst (NULL_TREE, size - 1, 0), + NULL_RTX, 0); t3 = force_operand (gen_rtx_MINUS (compute_mode, t1, nsign), NULL_RTX); t4 = expand_divmod (0, TRUNC_DIV_EXPR, compute_mode, t3, op1, @@ -3955,7 +3993,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, rtx t1, t2, t3; unsigned HOST_WIDE_INT d = INTVAL (op1); t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (floor_log2 (d), 0), + build_int_cst (NULL_TREE, + floor_log2 (d), 0), tquotient, 1); t2 = expand_binop (compute_mode, and_optab, op0, GEN_INT (d - 1), @@ -4053,7 +4092,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, rtx t1, t2, t3; unsigned HOST_WIDE_INT d = INTVAL (op1); t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (floor_log2 (d), 0), + build_int_cst (NULL_TREE, + floor_log2 (d), 0), tquotient, 0); t2 = expand_binop (compute_mode, and_optab, op0, GEN_INT (d - 1), @@ -4175,7 +4215,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, pre_shift = floor_log2 (d & -d); ml = invert_mod2n (d >> pre_shift, size); t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (pre_shift, 0), NULL_RTX, unsignedp); + build_int_cst (NULL_TREE, pre_shift, 0), + NULL_RTX, unsignedp); quotient = expand_mult (compute_mode, t1, gen_int_mode (ml, compute_mode), NULL_RTX, 1); @@ -4209,7 +4250,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, } tem = plus_constant (op1, -1); tem = expand_shift (RSHIFT_EXPR, compute_mode, tem, - build_int_2 (1, 0), NULL_RTX, 1); + build_int_cst (NULL_TREE, 1, 0), + NULL_RTX, 1); do_cmp_and_jump (remainder, tem, LEU, compute_mode, label); expand_inc (quotient, const1_rtx); expand_dec (remainder, op1); @@ -4234,12 +4276,14 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, abs_rem = expand_abs (compute_mode, remainder, NULL_RTX, 1, 0); abs_op1 = expand_abs (compute_mode, op1, NULL_RTX, 1, 0); tem = expand_shift (LSHIFT_EXPR, compute_mode, abs_rem, - build_int_2 (1, 0), NULL_RTX, 1); + build_int_cst (NULL_TREE, 1, 0), + NULL_RTX, 1); do_cmp_and_jump (tem, abs_op1, LTU, compute_mode, label); tem = expand_binop (compute_mode, xor_optab, op0, op1, NULL_RTX, 0, OPTAB_WIDEN); mask = expand_shift (RSHIFT_EXPR, compute_mode, tem, - build_int_2 (size - 1, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, size - 1, 0), + NULL_RTX, 0); tem = expand_binop (compute_mode, xor_optab, mask, const1_rtx, NULL_RTX, 0, OPTAB_WIDEN); tem = expand_binop (compute_mode, sub_optab, tem, mask, @@ -4382,20 +4426,23 @@ make_tree (tree type, rtx x) switch (GET_CODE (x)) { case CONST_INT: - t = build_int_2 (INTVAL (x), - (TYPE_UNSIGNED (type) - && (GET_MODE_BITSIZE (TYPE_MODE (type)) - < HOST_BITS_PER_WIDE_INT)) - || INTVAL (x) >= 0 ? 0 : -1); - TREE_TYPE (t) = type; - return t; - + { + HOST_WIDE_INT hi = 0; + + if (INTVAL (x) < 0 + && !(TYPE_UNSIGNED (type) + && (GET_MODE_BITSIZE (TYPE_MODE (type)) + < HOST_BITS_PER_WIDE_INT))) + hi = -1; + + t = build_int_cst (type, INTVAL (x), hi); + + return t; + } + case CONST_DOUBLE: if (GET_MODE (x) == VOIDmode) - { - t = build_int_2 (CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x)); - TREE_TYPE (t) = type; - } + t = build_int_cst (type, CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x)); else { REAL_VALUE_TYPE d; |