diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2007-02-15 18:50:49 -0500 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2007-02-15 18:50:49 -0500 |
commit | 5039610b9630459799b24f64fb9ffdd810b8eee9 (patch) | |
tree | 4c9dae557e2aa52bff7b845dd7b1270c19be7a2f /gcc/fortran | |
parent | dc90f45b24a668f465d50a4db2253c7b84cd1c2d (diff) | |
download | gcc-5039610b9630459799b24f64fb9ffdd810b8eee9.zip gcc-5039610b9630459799b24f64fb9ffdd810b8eee9.tar.gz gcc-5039610b9630459799b24f64fb9ffdd810b8eee9.tar.bz2 |
tree.h (enum tree_code_class): Add tcc_vl_exp.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree.h (enum tree_code_class): Add tcc_vl_exp.
(VL_EXP_CLASS_P): New.
(TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(TREE_OPERAND_CHECK_CODE): Likewise.
(GIMPLE_STMT_OPERAND_CHECK): Likewise.
(TREE_RTL_OPERAND_CHECK): Likewise.
(tree_operand_check_failed): Make second parameter the whole tree
instead of its code. Fixed callers.
(VL_EXP_CHECK): New.
(TREE_OPERAND_LENGTH): New.
(VL_EXP_OPERAND_LENGTH): New.
(CALL_EXPR_FN): New.
(CALL_EXPR_STATIC_CHAIN): New.
(CALL_EXPR_ARGS): New.
(CALL_EXPR_ARG): New.
(call_expr_nargs): New.
(CALL_EXPR_ARGP): New.
(build_nt_call_list): Declare.
(build_vl_exp_stat): Declare.
(build_vl_exp): New.
(build_call_list): Declare.
(build_call_nary): Declare.
(build_call_valist): Declare.
(build_call_array): Declare.
(call_expr_arg): Declare.
(call_expr_argp): Declare.
(call_expr_arglist): Declare.
(fold_build_call_list): Declare.
(fold_build_call_list_initializer): Declare.
(fold_call_expr): Declare to replace fold_builtin.
(fold_builtin_fputs): Update to agree with modified definition.
(fold_builtin_strcpy): Likewise.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_build_call_expr): Declare.
(fold_builtin_call_list): Declare.
(fold_builtin_call_valist): Declare.
(build_call_expr): Declare.
(validate_arglist): Update to agree with modified definition.
(tree_operand_length): New.
(call_expr_arg_iterator): New.
(init_call_expr_arg_iterator): New.
(next_call_expr_arg): New.
(first_call_expr_arg): New.
(more_call_expr_args_p): New.
(FOR_EACH_CALL_EXPR_ARG): New.
* tree.c (tree_code_class_string): Add entries for tcc_vl_exp
and tcc_gimple_stmt.
(tree_code_size): Update documentation. Use sizeof (tree) rather
than sizeof (char *).
(tree_size): Likewise. Add case for tcc_vl_exp.
(tree_node_structure): Add case for tcc_vl_exp.
(contains_placeholder_p): Likewise.
(substitute_in_expr): Likewise.
(substitute_placeholder_in_expr): Likewise.
(stabilize_reference_1): Likewise.
(build3_stat): Remove logic for CALL_EXPRs. Replace with assertion
to diagnose breakage of this interface for constructing CALL_EXPRs.
(build_nt): Add similar assertion here.
(build_nt_call_list): New.
(simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors.
(iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(get_callee_fndecl): Use new CALL_EXPR accessors.
(tree_operand_check_failed): Change parameters to pass entire node
instead of its code, so that we can call TREE_OPERAND_LENGTH on it.
(process_call_operands): New.
(build_vl_exp_stat): New.
(build_call_list): New.
(build_call_nary): New.
(build_call_valist): New.
(build_call_array): New.
(walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(call_expr_arglist): New.
* tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use
tcc_vl_exp instead of a fixed-size tcc_expression.
* doc/c-tree.texi (CALL_EXPR): Document new representation and
accessors for CALL_EXPRs.
(AGGR_INIT_EXPR): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* builtins.c (c_strlen): Return NULL_TREE instead of 0.
(expand_builtin_nonlocal_goto): Change parameter to be entire
CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors.
(expand_builtin_prefetch): Likewise.
(expand_builtin_classify_type): Likewise.
(mathfn_built_in): Return NULL_TREE instead of 0.
(expand_errno_check): Use new CALL_EXPR accessors.
(expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors.
Return NULL_RTX instead of 0.
(expand_builtin_mathfn_2): Likewise.
(expand_builtin_mathfn_3): Likewise.
(expand_builtin_interclass_mathfn): Likewise.
(expand_builtin_sincos): Likewise.
(expand_builtin_cexpi): Likewise.
(expand_builtin_int_roundingfn): Likewise.
(expand_builtin_int_roundingfn_2): Likewise.
(expand_builtin_pow): Likewise.
(expand_builtin_powi): Likewise.
(expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead
of arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_RTX instead of 0.
(expand_builtin_strstr): Likewise.
(expand_builtin_strchr): Likewise.
(expand_builtin_strrchr): Likewise.
(expand_builtin_strpbrk): Likewise.
(expand_builtin_memcpy): Likewise.
(expand_builtin_mempcpy): Likewise.
(expand_builtin_mempcpy_args): New.
(expand_builtin_memmove): Similarly to expand_builtin_mempcpy.
(expand_builtin_memmove_args): New.
(expand_builtin_bcopy): Similarly to expand_builtin_mempcpy.
(expand_movstr): Likewise.
(expand_builtin_strcpy): Likewise.
(expand_builtin_strcpy_args): New.
(expand_builtin_stpcpy): Similarly to expand_builtin_strcpy.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset): Likewise.
(expand_builtin_memset_args): New.
(expand_builtin_bzero): Similarly to expand_builtin_memset.
(expand_builtin_memcmp): Likewise.
(expand_builtin_strcmp): Likewise.
(expand_builtin_strncmp): Likewise.
(expand_builtin_strcat): Likewise.
(expand_builtin_strncat): Likewise.
(expand_builtin_strspn): Likewise.
(expand_builtin_strcspn): Likewise.
(expand_builtin_args_info): Likewise.
(expand_builtin_va_start): Likewise.
(gimplify_va_arg_expr): Likewise.
(expand_builtin_va_end): Likewise.
(expand_builtin_va_copy): Likewise.
(expand_builtin_frame_address): Likewise.
(expand_builtin_alloca): Likewise.
(expand_builtin_bswap): Likewise.
(expand_builtin_unop): Likewise.
(expand_builtin_fputs): Likewise.
(expand_builtin_expect): Likewise.
(expand_builtin_fabs): Likewise.
(expand_builtin_copysign): Likewise.
(expand_builtin_printf): Likewise.
(expand_builtin_fprintf): Likewise.
(expand_builtin_sprintf): Likewise.
(expand_builtin_init_trampoline): Likewise.
(expand_builtin_signbit): Likewise.
(expand_builtin_fork_or_exec): Likewise.
(expand_builtin_sync_operation): Likewise.
(expand_builtin_compare_and_swap): Likewise.
(expand_builtin_lock_test_and_set): Likewise.
(expand_builtin_lock_release): Likewise.
(expand_builtin): Likewise.
(builtin_mathfn_code): Likewise.
(fold_builtin_constant_p): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_expect): Likewise.
(fold_builtin_classify_type): Likewise.
(fold_builtin_strlen): Likewise.
(fold_builtin_nan): Likewise.
(integer_valued_real_p): Likewise.
(fold_trunc_transparent_mathfn): Likewise.
(fold_fixed_mathfn): Likewise.
(fold_builtin_cabs): Likewise.
(fold_builtin_sqrt): Likewise.
(fold_builtin_cbrt): Likewise.
(fold_builtin_cos): Likewise.
(fold_builtin_cosh): Likewise.
(fold_builtin_tan): Likewise.
(fold_builtin_sincos): Likewise.
(fold_builtin_cexp): Likewise.
(fold_builtin_trunc): Likewise.
(fold_builtin_floor): Likewise.
(fold_builtin_ceil): Likewise.
(fold_builtin_round): Likewise.
(fold_builtin_int_roundingfn): Likewise.
(fold_builtin_bitop): Likewise.
(fold_builtin_bswap): Likewise.
(fold_builtin_logarithm): Likewise.
(fold_builtin_hypot): Likewise.
(fold_builtin_pow): Likewise.
(fold_builtin_powi): Likewise.
(fold_builtin_exponent): Likewise.
(fold_builtin_memset): Likewise.
(fold_builtin_bzero): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_bcopy): Deleted; call site changed to invoke
fold_builtin_memory_op directly.
(fold_builtin_strcpy): Similarly as for fold_builtin_memory_op.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memcmp): Likewise.
(fold_builtin_strcmp): Likewise.
(fold_builtin_strncmp): Likewise.
(fold_builtin_signbit): Likewise.
(fold_builtin_copysign): Likewise.
(fold_builtin_isascii): Likewise.
(fold_builtin_toascii): Likewise.
(fold_builtin_isdigit): Likewise.
(fold_builtin_fabs): Likewise.
(fold_builtin_abs): Likewise.
(fold_builtin_fmin_fmax): Likewise.
(fold_builtin_carg): Likewise.
(fold_builtin_classify): Likewise.
(fold_builtin_unordered_cmp): Likewise.
(fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4):
New functions split out from fold_builtin_1.
(fold_builtin_n): New.
(fold_builtin_varargs): New.
(fold_builtin): Deleted. Most callers changed to use fold_call_expr
instead.
(fold_call_expr): New.
(build_function_call_expr): Rewrite to use new helper function.
(fold_builtin_call_list): New.
(build_call_expr): New.
(fold_builtin_call_valist): New.
(rewrite_call_expr): New.
(validate_arg): New.
(validate_arglist): Change parameter to be entire CALL_EXPR instead
of an arglist. Change return type to bool. Use new CALL_EXPR
accessors.
(fold_builtin_strstr): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(fold_builtin_strcat): Likewise.
(fold_builtin_strncat): Likewise.
(fold_builtin_strspn): Likewise.
(fold_builtin_strcspn): Likewise.
(fold_builtin_fputs): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_builtin_sprintf): Likewise.
(expand_builtin_object_size): Use new CALL_EXPR accessors. Use
NULL_RTX instead of 0.
(expand_builtin_memory_chk): Likewise.
(maybe_emit_chk_warning): Likewise.
(maybe_emit_sprintf_chk_warning): Likewise.
(fold_builtin_object_size): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strncat_chk): Likewise.
(fold_builtin_sprintf_chk): Likewise.
(fold_builtin_snprintf_chk): Likewise.
(fold_builtin_printf): Likewise.
(fold_builtin_vprintf): Likewise.
* fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and
constructors.
(operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case.
(make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(extract_muldiv_1): Add VL_EXP_CLASS_P case.
(fold_mathfn_compare): Use new CALL_EXPR accessors and constructors.
(fold_unary): Likewise.
(fold_binary): Likewise.
(fold_ternary): Remove CALL_EXPR case, since they are no longer
ternary expressions.
(fold): Add logic for tcc_vl_exp.
(fold_checksum_tree): Make it know about tcc_vl_exp. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(fold_build3_stat): Add assertion to flag broken interface for
constructing CALL_EXPRs.
(fold_build_call_list): New.
(fold_build_call_list_initializer): New.
(tree_expr_nonnegative_p): Use new CALL_EXPR accessors and
constructors.
(fold_strip_sign_ops): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR
accessors and dump arguments explicitly.
* tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(dump_generic_node): Use new CALL_EXPR accessors and walk arguments
explicitly.
(print_call_name): Use new CALL_EXPR accessors.
* print-tree.c (print_node): Add case tcc_vl_exp. Print
CALL_EXPR arguments explicitly instead of as a list. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors.
(vrp_visit_stmt): Likewise.
* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it
know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(force_move_till_expr): Likewise.
* targhooks.c (default_external_stack_protect_fail): Use
build_call_expr instead of build_function_call_expr.
(default_hidden_stack_protect_fail): Likewise.
* tree-complex.c (expand_complex_libcall): Use build_call_expr to
build the call.
* cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors
and walk arguments explicitly.
* tree-ssa-loop-niter.c (simplify_replace_tree): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(expand_simple_operations): Likewise.
(infer_loop_bounds_from_array): Use new CALL_EXPR accessors.
* gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
(walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs.
* optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* value_prof.c (tree_ic): Use new CALL_EXPR accessors.
(tree_ic_transform): Likewise.
(interesting_stringop_to_profile_p): Pass entire CALL_EXPR as
parameter instead of arglist. Fix callers.
(tree_stringop_fixed_value): Use new CALL_EXPR accessors.
(tree_stringops_transform): Likewise.
(tree_indirect_call_to_profile): Likewise.
(tree_stringops_values_to_profile): Likewise.
* tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator.
(eliminate_tail_call): Likewise.
* ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors.
* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
Use TREE_OPERAND_LENGTH and generalize to handle any number of
operands.
(instantiate_parameters_1): Can't handle tcc_vl_exp here.
* omp-low.c (build_omp_barrier): Use build_call_expr.
(lower_rec_input_clauses): Likewise.
(lower_reduction_clauses): Likewise.
(expand_parallel_call): Likewise.
(maybe_catch_exception): Likewise.
(expand_omp_for_generic): Likewise.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_sections): Likewise.
(lower_omp_single_simple): Likewise.
(lower_omp_single_copy): Likewise.
(lower_omp_master): Likewise.
(lower_omp_ordered): Likewise.
(lower_omp_critical): Likewise.
* ipa-reference.c (check-call): Use new CALL_EXPR iterator.
(scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR.
* tree-gimple.c (is_gimple_call_addr): Fix doc.
(recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH. Add tcc_vl_exp case.
* tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH
and generalize to handle any number of operands.
(chrec_contains_undetermined): Likewise.
(tree_contains_chrecs): Likewise.
(evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH.
* cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors.
* tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use
fold_call_expr instead of fold_builtin.
(ccp_fold_builtin): Likewise. Update calls into builtins.c to
match declarations there.
(fold_stmt): Use new CALL_EXPR constructor and accessors. Doc
updates.
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* ipa-pure-const.c (check_call): Use new CALL_EXPR accessors.
(scan_function): Add case tcc_vl_exp for CALL_EXPR.
* tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR
accessors.
* tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr.
(execute_cse_sincos): Use new CALL_EXPR accessors.
* tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator.
* gimple-low.c (lower_function_body): Use build_call_expr.
(lower_builtin_setjmp): Likewise.
* expr.c (emit_block_move_via_libcall): Use build_call_expr.
(set_storage_via_libcall): Likewise.
(safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(expand_expr_real_1): Use new CALL_EXPR accessors.
* tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and
generalize to handle any number of operands.
(TB_parent_eq): Likewise.
* predict.c (expr_expected_value): Use new CALL_EXPR accessors.
(strip_builtin_expect): Likewise.
* function.c (gimplify_parameters): Use build_call_expr.
* tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* ipa-type-escape.c (check_call): Use new CALL_EXPR iterators.
(scan_for_refs): Add case tcc_vl_exp for CALL_EXPR.
* tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR
iterators.
* gimplify.c (build_stack_save_restore): Use build_call_expr.
(gimplify_decl_expr): Likewise.
(gimplify_call_expr): Use fold_call_expr instead of fold_builtin.
Use new CALL_EXPR iterators.
(gimplify_modify_expr_to_memcpy): Use build_call_expr.
(gimplify_modify_expr_to_memset): Likewise.
(gimplify_variable_sized_compare): Likewise.
(gimplify_omp_atomic_fetch_op): Likewise.
(gimplify_omp_atomic_pipeline): Likewise.
(gimplify_omp_atomic_mutex): Likewise.
(gimplify_function_tree): Likewise.
* calls.c (alloca_call_p): Use new CALL_EXPR accessors.
(call_expr_flags): Likewise.
(expand_call): Likewise.
* except.c (expand_builtin_eh_return_data_regno): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
* coverage.c (create_coverage): Use build_call_expr.
* tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete.
(temp_call_expr_obstack): New.
(pool_copy_list): Delete.
(temp_copy_call_expr): New.
(phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors. Get rid of special goo for copying argument
lists and use temp_copy_call_expr instead.
(valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors.
(create_expression_by_pieces): Likewise. Use build_call_array
to construct the result instead of fold_build3.
(create_value_expr_from): Add tcc_vl_exp. Delete special goo for
dealing with argument lists.
(init_pre): Remove references to expression_node_pool and
list_node_pool. Init temp_call_expr_obstack instead.
(fini_pre): Remove references to expression_node_pool and
list_node_pool.
* tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors
and walk arguments explicitly instead of as a list.
* tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr.
(mx_register_decls): Likewise.
(mudflap_register_call): Likewise.
(mudflap_finish_file): Likewise.
* ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors.
(ipa_callsite_compute_param): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR
accessors and constructor.
* tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR
accessors and constructor.
(convert_tramp_reference): Likewise.
(convert_call_expr): Likewise.
(finalize_nesting_tree_1): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR
accessors.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr.
* tree-inline.c (initialize_inlined_parameters): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
(estimate_num_insns_1): Use new CALL_EXPR accessors.
(expand_call_inline): Tidy up call to initialize_inlined_parameters.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(vectorizable_reduction): Likewise.
(vectorizable_call): Use new CALL_EXPR iterators.
(vectorizable_conversion): Use build_call_expr.
(vectorizable_operation): Use TREE_OPERAND_LENGTH.
(vect_gen_widened_results_half): Use build_call_expr.
(vect_setup_realignment): Likewise.
(vectorizable_live_operation): Use TREE_OPERAND_LENGTH.
* tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors.
(pass_through_call): Likewise.
(compute_object_sizes): Likewise. Use fold_call_expr instead of
fold_builtin.
* tree-profile.c (tree_gen_interval_profiler): Use build_call_expr.
(tree_gen_pow2_profiler): Likewise.
(tree_gen_one_value_profiler): Likewise.
(tree_gen_ic_func_profiler): Likewise.
(tree_gen_average_profiler): Likewise.
(tree_gen_ior_profiler): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp.
(find_func_aliases): Use new CALL_EXPR accessors. Add case
tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* convert.c (convert_to_real): Use new CALL_EXPR accessors and
constructor.
(convert_to_integer): Likewise.
* tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR
accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR
accessors.
* config/frv/frv.c (frv_expand_builtin): Likewise.
* config/s390/s390.c (s390_expand_builtin): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr.
(sparc_expand_builtin): Use new CALL_EXPR accessors.
* config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise.
(ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter
instead of arglist. Use new CALL_EXPR accessors on it. Fix callers.
(ix86_expand_store_builtin): Likewise.
(ix86_expand_unop_builtin): Likewise.
(ix86_expand_unop1_builtin): Likewise.
(ix86_expand_sse_compare): Likewise.
(ix86_expand_sse_comi): Likewise.
(ix86_expand_vec_init_builtin): Likewise.
(ix86_expand_vec_ext_builtin): Likewise.
(ix86_expand_vec_set_builtin): Likewise.
(ix86_expand_builtin): Use new CALL_EXPR accessors.
* config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors.
* config/c4x/c4x.c (c4x_expand_builtin): Likewise.
* config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(iq2000_expand_builtin): Use new CALL_EXPR accessors.
* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use
build_call_expr.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
(rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_abs_builtin): Likewise.
(rs6000_expand_binop_builtin): Likewise.
(altivec_expand_predicate_builtin): Likewise.
(altivec_expand_lv_builtin): Likewise.
(spe_expand_stv_builtin): Likewise.
(altivec_expand_stv_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise.
(altivec_expand_ld_builtin): Use new CALL_EXPR accessors.
(altivec_expand_st_builtin): Likewise.
(altivec_expand_dst_builtin): Likewise.
(altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_vec_set_builtin): Likewise.
(altivec_expand_vec_ext_builtin): Likewise.
(altivec_expand_builtin): Use new CALL_EXPR accessors.
(spe_expand_builtin): Likewise.
(spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(spe_expand_evsel_builtin): Likewise.
(rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and
FCFSX cases must construct whole new CALL_EXPR, not just arglist.
* config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(arm_expand_unop_builtin): Likewise.
(arm_expand_builtin): Use new CALL_EXPR accessors.
* config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR
accessors.
* config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(bfin_expand_unop_builtin): Likewise.
(bfin_expand_builtin): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* c-semantics.c (build_stmt): Add internal diagnostic check.
* c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR
accessors. Print arguments explicitly instead of as a list.
* c-typeck.c (build_function_call): Use new CALL_EXPR constructors.
* c-omp.c (c_finish_omp_barrier): Use build_call_expr.
(c_finish_omp_flish): Likewise.
* c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse
arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(check_function_arguments_recurse): Use new CALL_EXPR accessors.
(c_warn_unused_result): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
Change class to tcc_vl_exp.
* call.c (build_call): Use build_call_list instead
of build3.
(build_over_call): Likewise.
(build_new_method_call): Use build_min_non_dep_call_list
instead of build_min_non_dep.
* error.c (dump_call_expr_args): New function.
(dump_aggr_init_expr_args): New function.
(dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
* cvt.c (convert_to_void): Use build_call_array instead
of build3; use new AGGR_INIT_EXPR accessor macros.
* mangle.c (write_expression): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
AGGR_INIT_EXPR accessor macros.
* cp-gimplify.c (cp_gimplify_init_expr): Use
AGGR_INIT_EXPR_SLOT to set the slot operand.
* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
(AGGR_INIT_EXPR_SLOT): New macro.
(AGGR_INIT_EXPR_ARG): New macro.
(aggr_init_expr_nargs): New macro.
(AGGR_INIT_EXPR_ARGP): New macro.
(aggr_init_expr_arg_iterator): New.
(init_aggr_init_expr_arg_iterator): New.
(next_aggr_init_expr_arg): New.
(first_aggr_init_expr_arg): New.
(more_aggr_init_expr_args_p): New.
(FOR_EACH_AGGR_INIT_EXPR_ARG): New.
(stabilize_aggr_init): New declaration.
(build_min_non_dep_call_list): Likewise.
* tree.c (process_aggr_init_operands): New function.
(build_aggr_init_array) New function.
(build_cplus_new): Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros. Replace use of build3 with
build_aggr_init_array.
(build_min_non_dep_call_list) New function.
(build_min_nt): Assert input code parameter is not a variable
length expression class.
(build_min, build_min_non_dep): Likewise.
(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
to check for equality instead of recursing. Handle tcc_vl_exp
tree code classes.
(stabilize_call): Update to only handle CALL_EXPRs, not
AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
(stabilize_aggr_init): New function.
(stabilize_init): Use it.
* cxx-pretty-print.c (pp_cxx_postfix_expression)
<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros and argument iterators.
* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
build_vl_exp. Iterate through the operands, recursively
processing each one.
(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
CALL_EXPR accessor macros.
(value_dependent_expression_p) <default>: Handle tcc_vl_exp
tree code classes. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
* semantics.c (finish_call_expr): Use build_nt_call_list
instead of build_nt.
(simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
accessor macros. Use build_call_array to construct the
CALL_EXPR node instead of build3
* decl2.c (build_offset_ref_call_from_tree): Use
build_nt_call_list and build_min_non_dep_call_list instead
of build_min_nt and build_min_non_dep.
* parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
Use build_nt_call_list instead of build_min_nt.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead
of build3.
(BUILD_MONITOR_EXIT): Likewise.
* java-gimplify.c (java_gimplify_component_ref): Use build_call_expr.
(java_gimplify_modify_expr): Likewise.
* class.c (cache_this_class_ref): Use build_call_expr.
(build_static_field_ref): Likewise.
(emit_indirect_register_classes): Likewise.
(emit_register_classes): Likewise.
* resource.c (write_resource_constructor): Use build_call_expr.
* builtins.c (builtin_creator_function): Change interpretation of
the second parameter to be the whole CALL_EXPR instead of the arglist.
(max_builtin): Tweak parameter list. Use new CALL_EXPR accessors.
(min_builtin): Likewise.
(abs_builtin): Likewise.
(java_build_function_call_expr): Likewise.
(convert_real): Likewise.
(UNMARSHAL3): Likewise.
(UNMARSHAL4): Likewise.
(UNMARSHAL5): Likewise.
(build_arglist_for_builtin): Delete. Fix callers to use
build_call_expr instead.
(putObject_builtin): Tweak parameter list. Use new CALL_EXPR
accessors.
(compareAndSwapInt_builtin): Likewise.
(compareAndSwapLong_builtin): Likewise.
(compareAndSwapObject_builtin): Likewise.
(putVolatile_builtin): Likewise.
(getVolatile_builtin): Likewise.
(VMSupportsCS8_builtin): Likewise.
(check_for_builtin): Pass entire CALL_EXPR to builtin expander
instead of arglist.
* expr.c (build_java_athrow): Use build_call_nary instead of build3.
(build_java_throw_out_of_bounds_exception): Likewise.
(java_check_reference): Likewise.
(build_java_arraystore_check): Likewise.
(build_newarray): Likewise.
(build_anewarray): Likewise.
(expand_java_multinewarray): Use build_call_list instead of build3.
(build_java_monitor): Use build_call_nary instead of build3.
(java_create_object): Likewise.
(expand_java_NEW): Likewise.
(build_instanceof): Likewise.
(expand_java_CHECKCAST): Likewise.
(build_java_soft_divmod): Likewise.
(build_java_binop): Likewise.
(build_field_ref): Likewise.
(build_class_init): Likewise.
(rewrite_arglist_getcaller): Use build_call_expr.
(build_invokeinterface): Use build_call_nary instead of build3.
(expand_invoke): Use build_call_list instead of build3.
(build_jni_stub): Use build_call_nary, build_call_list, or
build_call_expr instead of build3.
(expand_java_field_op): Use build_call_expr instead of build3.
(force_evaluation_order): Use new CALL_EXPR accessors.
* lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
(objc_get_callee_fndecl): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* trans-expr.c (gfc_conv_power_op): Use build_call_expr.
(gfc_conv_string_tmp): Likewise.
(gfc_conv_concat_op): Likewise.
(gfc_build_compare_string): Likewise.
(gfc_conv_function_call): Use build_call_list instead of build3.
* trans-array.c (gfc_trans_allocate_array_storage): Use
build_call_expr.
(gfc_grow_array): Likewise.
(gfc_trans_array_ctor_element): Likewise.
(gfc_trans_array_constructor_value): Likewise.
(gfc_array_allocate): Likewise.
(gfc_array_deallocate): Likewise.
(gfc_trans_auto_array_allocation): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_conv_array_parameter): Likewise.
(gfc_trans_dealloc_allocated): Likewise.
(gfc_duplicate_allocatable): Likewise.
* trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr.
(gfc_trans_omp_flush): Likewise.
* trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr.
(gfc_trans_pause): Likewise.
(gfc_trans_stop): Likewise.
(gfc_trans_character_select): Likewise.
(gfc_do_allocate): Likewise.
(gfc_trans_assign_need_temp): Likewise.
(gfc_trans_pointer_assign_need_temp): Likewise.
(gfc_trans_forall_1): Likewise.
(gfc_trans_where_2): Likewise.
(gfc_trans_allocate): Likewise.
(gfc_trans_deallocate): Likewise.
* trans.c (gfc_trans_runtime_check): Use build_call_expr.
* trans-io.c (gfc_trans_open): Use build_call_expr.
(gfc_trans_close): Likewise.
(build_filepos): Likewise.
(gfc_trans_inquire): Likewise.
(NML_FIRST_ARG): Delete.
(NML_ADD_ARG): Delete.
(transfer_namelist_element): Use build_call_expr.
(build_dt): Likewise.
(gfc_trans_dt_end): Likewise.
(transfer_expr): Likewise.
(transfer_array-desc): Likewise.
* trans-decl.c (gfc_generate_function_code): Use build_call_expr.
(gfc_generate_constructors): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr.
(gfc_conv_intrinsic_fdate): Likewise.
(gfc_conv_intrinsic_ttynam): Likewise.
(gfc_conv_intrinsic_array_transfer): Likewise.
(gfc_conv_associated): Likewise.
(gfc_conv_intrinsic_si_kind): Likewise.
(gfc_conv_intrinsic_trim): Likewise.
(gfc_conv_intrinsic_repeat: Likewise.
(gfc_conv_intrinsic_iargc): Likewise.
Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com>
Co-Authored-By: Lee Millward <lee.millward@codesourcery.com>
From-SVN: r122018
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 65 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 90 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 74 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 84 | ||||
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 68 | ||||
-rw-r--r-- | gcc/fortran/trans-io.c | 66 | ||||
-rw-r--r-- | gcc/fortran/trans-openmp.c | 4 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 73 | ||||
-rw-r--r-- | gcc/fortran/trans.c | 12 |
9 files changed, 223 insertions, 313 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bf9fe04..796c8b9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,68 @@ +2007-02-15 Sandra Loosemore <sandra@codesourcery.com> + Brooks Moses <brooks.moses@codesourcery.com> + Lee Millward <lee.millward@codesourcery.com> + + * trans-expr.c (gfc_conv_power_op): Use build_call_expr. + (gfc_conv_string_tmp): Likewise. + (gfc_conv_concat_op): Likewise. + (gfc_build_compare_string): Likewise. + (gfc_conv_function_call): Use build_call_list instead of build3. + + * trans-array.c (gfc_trans_allocate_array_storage): Use + build_call_expr. + (gfc_grow_array): Likewise. + (gfc_trans_array_ctor_element): Likewise. + (gfc_trans_array_constructor_value): Likewise. + (gfc_array_allocate): Likewise. + (gfc_array_deallocate): Likewise. + (gfc_trans_auto_array_allocation): Likewise. + (gfc_trans_dummy_array_bias): Likewise. + (gfc_conv_array_parameter): Likewise. + (gfc_trans_dealloc_allocated): Likewise. + (gfc_duplicate_allocatable): Likewise. + + * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. + (gfc_trans_omp_flush): Likewise. + + * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. + (gfc_trans_pause): Likewise. + (gfc_trans_stop): Likewise. + (gfc_trans_character_select): Likewise. + (gfc_do_allocate): Likewise. + (gfc_trans_assign_need_temp): Likewise. + (gfc_trans_pointer_assign_need_temp): Likewise. + (gfc_trans_forall_1): Likewise. + (gfc_trans_where_2): Likewise. + (gfc_trans_allocate): Likewise. + (gfc_trans_deallocate): Likewise. + + * trans.c (gfc_trans_runtime_check): Use build_call_expr. + + * trans-io.c (gfc_trans_open): Use build_call_expr. + (gfc_trans_close): Likewise. + (build_filepos): Likewise. + (gfc_trans_inquire): Likewise. + (NML_FIRST_ARG): Delete. + (NML_ADD_ARG): Delete. + (transfer_namelist_element): Use build_call_expr. + (build_dt): Likewise. + (gfc_trans_dt_end): Likewise. + (transfer_expr): Likewise. + (transfer_array-desc): Likewise. + + * trans-decl.c (gfc_generate_function_code): Use build_call_expr. + (gfc_generate_constructors): Likewise. + + * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. + (gfc_conv_intrinsic_fdate): Likewise. + (gfc_conv_intrinsic_ttynam): Likewise. + (gfc_conv_intrinsic_array_transfer): Likewise. + (gfc_conv_associated): Likewise. + (gfc_conv_intrinsic_si_kind): Likewise. + (gfc_conv_intrinsic_trim): Likewise. + (gfc_conv_intrinsic_repeat: Likewise. + (gfc_conv_intrinsic_iargc): Likewise. + 2007-02-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/30779 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 1c89975..64ea9d6 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -501,7 +501,6 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post, bool dynamic, bool dealloc) { tree tmp; - tree args; tree desc; bool onstack; @@ -534,15 +533,13 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post, else { /* Allocate memory to hold the data. */ - args = gfc_chainon_list (NULL_TREE, size); - if (gfc_index_integer_kind == 4) tmp = gfor_fndecl_internal_malloc; else if (gfc_index_integer_kind == 8) tmp = gfor_fndecl_internal_malloc64; else gcc_unreachable (); - tmp = build_function_call_expr (tmp, args); + tmp = build_call_expr (tmp, 1, size); tmp = gfc_evaluate_now (tmp, pre); gfc_conv_descriptor_data_set (pre, desc, tmp); } @@ -559,8 +556,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post, /* Free the temporary. */ tmp = gfc_conv_descriptor_data_get (desc); tmp = fold_convert (pvoid_type_node, tmp); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp); gfc_add_expr_to_block (post, tmp); } } @@ -829,7 +825,7 @@ gfc_get_iteration_count (tree start, tree end, tree step) static void gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra) { - tree args; + tree arg0, arg1; tree tmp; tree size; tree ubound; @@ -844,14 +840,12 @@ gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra) gfc_add_modify_expr (pblock, ubound, tmp); /* Get the value of the current data pointer. */ - tmp = gfc_conv_descriptor_data_get (desc); - args = gfc_chainon_list (NULL_TREE, tmp); + arg0 = gfc_conv_descriptor_data_get (desc); /* Calculate the new array size. */ size = TYPE_SIZE_UNIT (gfc_get_element_type (TREE_TYPE (desc))); tmp = build2 (PLUS_EXPR, gfc_array_index_type, ubound, gfc_index_one_node); - tmp = build2 (MULT_EXPR, gfc_array_index_type, tmp, size); - args = gfc_chainon_list (args, tmp); + arg1 = build2 (MULT_EXPR, gfc_array_index_type, tmp, size); /* Pick the appropriate realloc function. */ if (gfc_index_integer_kind == 4) @@ -862,7 +856,7 @@ gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra) gcc_unreachable (); /* Set the new data pointer. */ - tmp = build_function_call_expr (tmp, args); + tmp = build_call_expr (tmp, 2, arg0, arg1); gfc_conv_descriptor_data_set (pblock, desc, tmp); } @@ -971,7 +965,6 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc, tree offset, gfc_se * se, gfc_expr * expr) { tree tmp; - tree args; gfc_conv_expr (se, expr); @@ -993,11 +986,8 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc, tmp = gfc_build_addr_expr (pchar_type_node, tmp); /* We know the temporary and the value will be the same length, so can use memcpy. */ - args = gfc_chainon_list (NULL_TREE, tmp); - args = gfc_chainon_list (args, se->expr); - args = gfc_chainon_list (args, se->string_length); - tmp = built_in_decls[BUILT_IN_MEMCPY]; - tmp = build_function_call_expr (tmp, args); + tmp = build_call_expr (built_in_decls[BUILT_IN_MEMCPY], 3, + tmp, se->expr, se->string_length); gfc_add_expr_to_block (&se->pre, tmp); } } @@ -1206,11 +1196,8 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type)); 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); - tmp = build_function_call_expr (built_in_decls[BUILT_IN_MEMCPY], - tmp); + tmp = build_call_expr (built_in_decls[BUILT_IN_MEMCPY], 3, + tmp, init, bound); gfc_add_expr_to_block (&body, tmp); *poffset = fold_build2 (PLUS_EXPR, gfc_array_index_type, @@ -3491,13 +3478,11 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat) else gcc_unreachable (); - tmp = NULL_TREE; /* The allocate_array variants take the old pointer as first argument. */ if (allocatable_array) - tmp = gfc_chainon_list (tmp, pointer); - tmp = gfc_chainon_list (tmp, size); - tmp = gfc_chainon_list (tmp, pstat); - tmp = build_function_call_expr (allocate, tmp); + tmp = build_call_expr (allocate, 3, pointer, size, pstat); + else + tmp = build_call_expr (allocate, 2, size, pstat); tmp = build2 (MODIFY_EXPR, void_type_node, pointer, tmp); gfc_add_expr_to_block (&se->pre, tmp); @@ -3533,9 +3518,7 @@ gfc_array_deallocate (tree descriptor, tree pstat) STRIP_NOPS (var); /* Parameter is the address of the data component. */ - tmp = gfc_chainon_list (NULL_TREE, var); - tmp = gfc_chainon_list (tmp, pstat); - tmp = build_function_call_expr (gfor_fndecl_deallocate, tmp); + tmp = build_call_expr (gfor_fndecl_deallocate, 2, var, pstat); gfc_add_expr_to_block (&block, tmp); /* Zero the data pointer. */ @@ -3826,15 +3809,13 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp); /* Allocate memory to hold the data. */ - tmp = gfc_chainon_list (NULL_TREE, size); - if (gfc_index_integer_kind == 4) fndecl = gfor_fndecl_internal_malloc; else if (gfc_index_integer_kind == 8) fndecl = gfor_fndecl_internal_malloc64; else gcc_unreachable (); - tmp = build_function_call_expr (fndecl, tmp); + tmp = build_call_expr (fndecl, 1, size); tmp = fold (convert (TREE_TYPE (decl), tmp)); gfc_add_modify_expr (&block, decl, tmp); @@ -3850,8 +3831,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) /* Free the temporary. */ tmp = convert (pvoid_type_node, decl); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp); gfc_add_expr_to_block (&block, tmp); return gfc_finish_block (&block); @@ -4020,8 +4000,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) gcc_assert (integer_onep (GFC_TYPE_ARRAY_STRIDE (type, 0))); /* A library call to repack the array if necessary. */ tmp = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc); - tmp = gfc_chainon_list (NULL_TREE, tmp); - stmt_unpacked = build_function_call_expr (gfor_fndecl_in_pack, tmp); + stmt_unpacked = build_call_expr (gfor_fndecl_in_pack, 1, tmp); stride = gfc_index_one_node; } @@ -4203,15 +4182,12 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) if (sym->attr.intent != INTENT_IN) { /* Copy the data back. */ - tmp = gfc_chainon_list (NULL_TREE, dumdesc); - tmp = gfc_chainon_list (tmp, tmpdesc); - tmp = build_function_call_expr (gfor_fndecl_in_unpack, tmp); + tmp = build_call_expr (gfor_fndecl_in_unpack, 2, dumdesc, tmpdesc); gfc_add_expr_to_block (&cleanup, tmp); } /* Free the temporary. */ - tmp = gfc_chainon_list (NULL_TREE, tmpdesc); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmpdesc); gfc_add_expr_to_block (&cleanup, tmp); stmt = gfc_finish_block (&cleanup); @@ -4778,23 +4754,19 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77) { desc = se->expr; /* Repack the array. */ - tmp = gfc_chainon_list (NULL_TREE, desc); - ptr = build_function_call_expr (gfor_fndecl_in_pack, tmp); + ptr = build_call_expr (gfor_fndecl_in_pack, 1, desc); ptr = gfc_evaluate_now (ptr, &se->pre); se->expr = ptr; gfc_start_block (&block); /* Copy the data back. */ - tmp = gfc_chainon_list (NULL_TREE, desc); - tmp = gfc_chainon_list (tmp, ptr); - tmp = build_function_call_expr (gfor_fndecl_in_unpack, tmp); + tmp = build_call_expr (gfor_fndecl_in_unpack, 2, desc, ptr); gfc_add_expr_to_block (&block, tmp); /* Free the temporary. */ tmp = convert (pvoid_type_node, ptr); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp); gfc_add_expr_to_block (&block, tmp); stmt = gfc_finish_block (&block); @@ -4836,9 +4808,7 @@ gfc_trans_dealloc_allocated (tree descriptor) /* Call array_deallocate with an int* present in the second argument. Although it is ignored here, it's presence ensures that arrays that are already deallocated are ignored. */ - tmp = gfc_chainon_list (NULL_TREE, var); - tmp = gfc_chainon_list (tmp, ptr); - tmp = build_function_call_expr (gfor_fndecl_deallocate, tmp); + tmp = build_call_expr (gfor_fndecl_deallocate, 2, var, ptr); gfc_add_expr_to_block (&block, tmp); /* Zero the data pointer. */ @@ -4880,7 +4850,6 @@ gfc_duplicate_allocatable(tree dest, tree src, tree type, int rank) tree tmp; tree size; tree nelems; - tree args; tree null_cond; tree null_data; stmtblock_t block; @@ -4897,11 +4866,10 @@ gfc_duplicate_allocatable(tree dest, tree src, tree type, int rank) TYPE_SIZE_UNIT (gfc_get_element_type (type))); /* Allocate memory to the destination. */ - tmp = gfc_chainon_list (NULL_TREE, size); if (gfc_index_integer_kind == 4) - tmp = build_function_call_expr (gfor_fndecl_internal_malloc, tmp); + tmp = build_call_expr (gfor_fndecl_internal_malloc, 1, size); else if (gfc_index_integer_kind == 8) - tmp = build_function_call_expr (gfor_fndecl_internal_malloc64, tmp); + tmp = build_call_expr (gfor_fndecl_internal_malloc64, 1, size); else gcc_unreachable (); tmp = fold (convert (TREE_TYPE (gfc_conv_descriptor_data_get (src)), @@ -4910,13 +4878,9 @@ gfc_duplicate_allocatable(tree dest, tree src, tree type, int rank) /* We know the temporary and the value will be the same length, so can use memcpy. */ - tmp = gfc_conv_descriptor_data_get (dest); - args = gfc_chainon_list (NULL_TREE, tmp); - tmp = gfc_conv_descriptor_data_get (src); - args = gfc_chainon_list (args, tmp); - args = gfc_chainon_list (args, size); tmp = built_in_decls[BUILT_IN_MEMCPY]; - tmp = build_function_call_expr (tmp, args); + tmp = build_call_expr (tmp, 3, gfc_conv_descriptor_data_get (dest), + gfc_conv_descriptor_data_get (src), size); gfc_add_expr_to_block (&block, tmp); tmp = gfc_finish_block (&block); diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 1bf11e3..d001ad9 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -3135,23 +3135,16 @@ gfc_generate_function_code (gfc_namespace * ns) if (sym->attr.is_main_program) { - tree arglist, gfc_int4_type_node; - - gfc_int4_type_node = gfc_get_int_type (4); - arglist = gfc_chainon_list (NULL_TREE, - build_int_cst (gfc_int4_type_node, - gfc_option.warn_std)); - arglist = gfc_chainon_list (arglist, - build_int_cst (gfc_int4_type_node, - gfc_option.allow_std)); - arglist = gfc_chainon_list (arglist, - build_int_cst (gfc_int4_type_node, - pedantic)); - arglist = gfc_chainon_list (arglist, - build_int_cst (gfc_int4_type_node, - gfc_option.flag_dump_core)); - - tmp = build_function_call_expr (gfor_fndecl_set_std, arglist); + tree gfc_int4_type_node = gfc_get_int_type (4); + tmp = build_call_expr (gfor_fndecl_set_std, 3, + build_int_cst (gfc_int4_type_node, + gfc_option.warn_std), + build_int_cst (gfc_int4_type_node, + gfc_option.allow_std), + build_int_cst (gfc_int4_type_node, + pedantic), + build_int_cst (gfc_int4_type_node, + gfc_option.flag_dump_core)); gfc_add_expr_to_block (&body, tmp); } @@ -3160,13 +3153,10 @@ gfc_generate_function_code (gfc_namespace * ns) needed. */ if (sym->attr.is_main_program && gfc_option.fpe != 0) { - tree arglist, gfc_c_int_type_node; - - gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); - arglist = gfc_chainon_list (NULL_TREE, - build_int_cst (gfc_c_int_type_node, - gfc_option.fpe)); - tmp = build_function_call_expr (gfor_fndecl_set_fpe, arglist); + tree gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); + tmp = build_call_expr (gfor_fndecl_set_fpe, 1, + build_int_cst (gfc_c_int_type_node, + gfc_option.fpe)); gfc_add_expr_to_block (&body, tmp); } @@ -3175,13 +3165,10 @@ gfc_generate_function_code (gfc_namespace * ns) if (sym->attr.is_main_program && gfc_option.convert != CONVERT_NATIVE) { - tree arglist, gfc_c_int_type_node; - - gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); - arglist = gfc_chainon_list (NULL_TREE, - build_int_cst (gfc_c_int_type_node, - gfc_option.convert)); - tmp = build_function_call_expr (gfor_fndecl_set_convert, arglist); + tree gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); + tmp = build_call_expr (gfor_fndecl_set_convert, 1, + build_int_cst (gfc_c_int_type_node, + gfc_option.convert)); gfc_add_expr_to_block (&body, tmp); } @@ -3190,26 +3177,22 @@ gfc_generate_function_code (gfc_namespace * ns) if (sym->attr.is_main_program && gfc_option.record_marker != 0) { - tree arglist, gfc_c_int_type_node; - - gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); - arglist = gfc_chainon_list (NULL_TREE, - build_int_cst (gfc_c_int_type_node, - gfc_option.record_marker)); - tmp = build_function_call_expr (gfor_fndecl_set_record_marker, arglist); + tree gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); + tmp = build_call_expr (gfor_fndecl_set_record_marker, 1, + build_int_cst (gfc_c_int_type_node, + gfc_option.record_marker)); gfc_add_expr_to_block (&body, tmp); - } if (sym->attr.is_main_program && gfc_option.max_subrecord_length != 0) { - tree arglist, gfc_c_int_type_node; + tree gfc_c_int_type_node; gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); - arglist = gfc_chainon_list (NULL_TREE, - build_int_cst (gfc_c_int_type_node, - gfc_option.max_subrecord_length)); - tmp = build_function_call_expr (gfor_fndecl_set_max_subrecord_length, arglist); + tmp = build_call_expr (gfor_fndecl_set_max_subrecord_length, + 1, + build_int_cst (gfc_c_int_type_node, + gfc_option.max_subrecord_length)); gfc_add_expr_to_block (&body, tmp); } @@ -3374,8 +3357,7 @@ gfc_generate_constructors (void) for (; gfc_static_ctors; gfc_static_ctors = TREE_CHAIN (gfc_static_ctors)) { - tmp = - build_function_call_expr (TREE_VALUE (gfc_static_ctors), NULL_TREE); + tmp = build_call_expr (TREE_VALUE (gfc_static_ctors), 0); DECL_SAVED_TREE (fndecl) = build_stmt (EXPR_STMT, tmp); } diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 1a97e31..839d768 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -748,7 +748,6 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) gfc_se lse; gfc_se rse; tree fndecl; - tree tmp; gfc_init_se (&lse, se); gfc_conv_expr_val (&lse, expr->value.op.op1); @@ -887,9 +886,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) break; } - tmp = gfc_chainon_list (NULL_TREE, lse.expr); - tmp = gfc_chainon_list (tmp, rse.expr); - se->expr = build_function_call_expr (fndecl, tmp); + se->expr = build_call_expr (fndecl, 2, lse.expr, rse.expr); } @@ -900,7 +897,6 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len) { tree var; tree tmp; - tree args; gcc_assert (TREE_TYPE (len) == gfc_charlen_type_node); @@ -918,15 +914,13 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len) { /* Allocate a temporary to hold the result. */ var = gfc_create_var (type, "pstr"); - args = gfc_chainon_list (NULL_TREE, len); - tmp = build_function_call_expr (gfor_fndecl_internal_malloc, args); + tmp = build_call_expr (gfor_fndecl_internal_malloc, 1, len); tmp = convert (type, tmp); gfc_add_modify_expr (&se->pre, var, tmp); /* Free the temporary afterwards. */ tmp = convert (pvoid_type_node, var); - args = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (gfor_fndecl_internal_free, args); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp); gfc_add_expr_to_block (&se->post, tmp); } @@ -945,7 +939,6 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr) tree len; tree type; tree var; - tree args; tree tmp; gcc_assert (expr->value.op.op1->ts.type == BT_CHARACTER @@ -974,14 +967,10 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr) var = gfc_conv_string_tmp (se, type, len); /* Do the actual concatenation. */ - args = NULL_TREE; - args = gfc_chainon_list (args, len); - args = gfc_chainon_list (args, var); - args = gfc_chainon_list (args, lse.string_length); - args = gfc_chainon_list (args, lse.expr); - args = gfc_chainon_list (args, rse.string_length); - args = gfc_chainon_list (args, rse.expr); - tmp = build_function_call_expr (gfor_fndecl_concat_string, args); + tmp = build_call_expr (gfor_fndecl_concat_string, 6, + len, var, + lse.string_length, lse.expr, + rse.string_length, rse.expr); gfc_add_expr_to_block (&se->pre, tmp); /* Add the cleanup for the operands. */ @@ -1205,17 +1194,9 @@ gfc_build_compare_string (tree len1, tree str1, tree len2, tree str2) tmp = fold_build2 (MINUS_EXPR, type, sc1, sc2); } else - { - tmp = NULL_TREE; - tmp = gfc_chainon_list (tmp, len1); - tmp = gfc_chainon_list (tmp, str1); - tmp = gfc_chainon_list (tmp, len2); - tmp = gfc_chainon_list (tmp, str2); - - /* Build a call for the comparison. */ - tmp = build_function_call_expr (gfor_fndecl_compare_string, tmp); - } - + /* Build a call for the comparison. */ + tmp = build_call_expr (gfor_fndecl_compare_string, 4, + len1, str1, len2, str2); return tmp; } @@ -1281,7 +1262,7 @@ gfc_conv_operator_assign (gfc_se *lse, gfc_se *rse, gfc_symbol *sym) gfc_init_se (&se, NULL); gfc_conv_function_val (&se, sym); tmp = TREE_TYPE (TREE_TYPE (TREE_TYPE (se.expr))); - tmp = build3 (CALL_EXPR, tmp, se.expr, args, NULL_TREE); + tmp = build_call_list (tmp, se.expr, args); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &lse->post); @@ -2407,8 +2388,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, } fntype = TREE_TYPE (TREE_TYPE (se->expr)); - se->expr = build3 (CALL_EXPR, TREE_TYPE (fntype), se->expr, - arglist, NULL_TREE); + se->expr = build_call_list (TREE_TYPE (fntype), se->expr, arglist); /* If we have a pointer function, but we don't want a pointer, e.g. something like @@ -2542,26 +2522,21 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest, /* Truncate string if source is too long. */ cond2 = fold_build2 (GE_EXPR, boolean_type_node, slen, dlen); - tmp2 = gfc_chainon_list (NULL_TREE, dest); - tmp2 = gfc_chainon_list (tmp2, src); - tmp2 = gfc_chainon_list (tmp2, dlen); - tmp2 = build_function_call_expr (built_in_decls[BUILT_IN_MEMMOVE], tmp2); + tmp2 = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE], + 3, dest, src, dlen); /* Else copy and pad with spaces. */ - tmp3 = gfc_chainon_list (NULL_TREE, dest); - tmp3 = gfc_chainon_list (tmp3, src); - tmp3 = gfc_chainon_list (tmp3, slen); - tmp3 = build_function_call_expr (built_in_decls[BUILT_IN_MEMMOVE], tmp3); + tmp3 = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE], + 3, dest, src, slen); tmp4 = fold_build2 (PLUS_EXPR, pchar_type_node, dest, fold_convert (pchar_type_node, slen)); - tmp4 = gfc_chainon_list (NULL_TREE, tmp4); - tmp4 = gfc_chainon_list (tmp4, build_int_cst - (gfc_get_int_type (gfc_c_int_kind), - lang_hooks.to_target_charset (' '))); - tmp4 = gfc_chainon_list (tmp4, fold_build2 (MINUS_EXPR, TREE_TYPE(dlen), - dlen, slen)); - tmp4 = build_function_call_expr (built_in_decls[BUILT_IN_MEMSET], tmp4); + tmp4 = build_call_expr (built_in_decls[BUILT_IN_MEMSET], 3, + tmp4, + build_int_cst (gfc_get_int_type (gfc_c_int_kind), + lang_hooks.to_target_charset (' ')), + fold_build2 (MINUS_EXPR, TREE_TYPE(dlen), + dlen, slen)); gfc_init_block (&tempblock); gfc_add_expr_to_block (&tempblock, tmp3); @@ -3585,7 +3560,7 @@ static tree gfc_trans_zero_assign (gfc_expr * expr) { tree dest, len, type; - tree tmp, args; + tree tmp; gfc_symbol *sym; sym = expr->symtree->n.sym; @@ -3613,10 +3588,8 @@ gfc_trans_zero_assign (gfc_expr * expr) len = fold_convert (size_type_node, len); /* Construct call to __builtin_memset. */ - args = build_tree_list (NULL_TREE, len); - args = tree_cons (NULL_TREE, integer_zero_node, args); - args = tree_cons (NULL_TREE, dest, args); - tmp = build_function_call_expr (built_in_decls[BUILT_IN_MEMSET], args); + tmp = build_call_expr (built_in_decls[BUILT_IN_MEMSET], + 3, dest, integer_zero_node, len); return fold_convert (void_type_node, tmp); } @@ -3627,7 +3600,7 @@ gfc_trans_zero_assign (gfc_expr * expr) static tree gfc_build_memcpy_call (tree dst, tree src, tree len) { - tree tmp, args; + tree tmp; /* Convert arguments to the correct types. */ if (!POINTER_TYPE_P (TREE_TYPE (dst))) @@ -3643,10 +3616,7 @@ gfc_build_memcpy_call (tree dst, tree src, tree len) len = fold_convert (size_type_node, len); /* Construct call to __builtin_memcpy. */ - args = build_tree_list (NULL_TREE, len); - args = tree_cons (NULL_TREE, src, args); - args = tree_cons (NULL_TREE, dst, args); - tmp = build_function_call_expr (built_in_decls[BUILT_IN_MEMCPY], args); + tmp = build_call_expr (built_in_decls[BUILT_IN_MEMCPY], 3, dst, src, len); return fold_convert (void_type_node, tmp); } diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 1bce128..e6bc46f 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -164,6 +164,8 @@ real_compnt_info; enum rounding_mode { RND_ROUND, RND_TRUNC, RND_CEIL, RND_FLOOR }; /* Evaluate the arguments to an intrinsic function. */ +/* FIXME: This function and its callers should be rewritten so that it's + not necessary to cons up a list to hold the arguments. */ static tree gfc_conv_intrinsic_function_args (gfc_se * se, gfc_expr * expr) @@ -1273,8 +1275,7 @@ gfc_conv_intrinsic_ctime (gfc_se * se, gfc_expr * expr) /* Free the temporary afterwards, if necessary. */ cond = build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); - arglist = gfc_chainon_list (NULL_TREE, var); - tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, var); tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); gfc_add_expr_to_block (&se->post, tmp); @@ -1309,8 +1310,7 @@ gfc_conv_intrinsic_fdate (gfc_se * se, gfc_expr * expr) /* Free the temporary afterwards, if necessary. */ cond = build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); - arglist = gfc_chainon_list (NULL_TREE, var); - tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, var); tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); gfc_add_expr_to_block (&se->post, tmp); @@ -1347,8 +1347,7 @@ gfc_conv_intrinsic_ttynam (gfc_se * se, gfc_expr * expr) /* Free the temporary afterwards, if necessary. */ cond = build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); - arglist = gfc_chainon_list (NULL_TREE, var); - tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, var); tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); gfc_add_expr_to_block (&se->post, tmp); @@ -2809,7 +2808,6 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr) tree lower; tree stride; tree stmt; - tree args; gfc_actual_arglist *arg; gfc_se argse; gfc_ss *ss; @@ -2850,15 +2848,13 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr) && arg->expr->ref->u.ar.type == AR_FULL)) { tmp = build_fold_addr_expr (argse.expr); - tmp = gfc_chainon_list (NULL_TREE, tmp); - source = build_function_call_expr (gfor_fndecl_in_pack, tmp); + source = build_call_expr (gfor_fndecl_in_pack, 1, tmp); source = gfc_evaluate_now (source, &argse.pre); /* Free the temporary. */ gfc_start_block (&block); tmp = convert (pvoid_type_node, source); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp); gfc_add_expr_to_block (&block, tmp); stmt = gfc_finish_block (&block); @@ -2998,13 +2994,11 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr) info, tmp, false, true, false); /* Use memcpy to do the transfer. */ - tmp = gfc_conv_descriptor_data_get (info->descriptor); - args = gfc_chainon_list (NULL_TREE, tmp); - tmp = fold_convert (pvoid_type_node, source); - args = gfc_chainon_list (args, source); - args = gfc_chainon_list (args, size_bytes); - tmp = built_in_decls[BUILT_IN_MEMCPY]; - tmp = build_function_call_expr (tmp, args); + tmp = build_call_expr (built_in_decls[BUILT_IN_MEMCPY], + 3, + gfc_conv_descriptor_data_get (info->descriptor), + fold_convert (pvoid_type_node, source), + size_bytes); gfc_add_expr_to_block (&se->pre, tmp); se->expr = info->descriptor; @@ -3024,7 +3018,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) tree type; tree ptr; gfc_ss *ss; - tree tmpdecl, tmp, args; + tree tmpdecl, tmp; /* Get a pointer to the source. */ arg = expr->value.function.actual; @@ -3059,13 +3053,10 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) /* Use memcpy to do the transfer. */ tmp = build1 (ADDR_EXPR, build_pointer_type (type), tmpdecl); - tmp = fold_convert (pvoid_type_node, tmp); - args = gfc_chainon_list (NULL_TREE, tmp); - tmp = fold_convert (pvoid_type_node, ptr); - args = gfc_chainon_list (args, tmp); - args = gfc_chainon_list (args, moldsize); - tmp = built_in_decls[BUILT_IN_MEMCPY]; - tmp = build_function_call_expr (tmp, args); + tmp = build_call_expr (built_in_decls[BUILT_IN_MEMCPY], 3, + fold_convert (pvoid_type_node, tmp), + fold_convert (pvoid_type_node, ptr), + moldsize); gfc_add_expr_to_block (&se->pre, tmp); se->expr = tmpdecl; @@ -3112,7 +3103,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr) gfc_se arg2se; tree tmp2; tree tmp; - tree args, fndecl; + tree fndecl; tree nonzero_charlen; tree nonzero_arraylen; gfc_ss *ss1, *ss2; @@ -3185,18 +3176,15 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr) /* A pointer to an array, call library function _gfor_associated. */ gcc_assert (ss2 != gfc_ss_terminator); - args = NULL_TREE; arg1se.want_pointer = 1; gfc_conv_expr_descriptor (&arg1se, arg1->expr, ss1); - args = gfc_chainon_list (args, arg1se.expr); arg2se.want_pointer = 1; gfc_conv_expr_descriptor (&arg2se, arg2->expr, ss2); gfc_add_block_to_block (&se->pre, &arg2se.pre); gfc_add_block_to_block (&se->post, &arg2se.post); - args = gfc_chainon_list (args, arg2se.expr); fndecl = gfor_fndecl_associated; - se->expr = build_function_call_expr (fndecl, args); + se->expr = build_call_expr (fndecl, 2, arg1se.expr, arg2se.expr); se->expr = build2 (TRUTH_AND_EXPR, boolean_type_node, se->expr, nonzero_arraylen); @@ -3287,8 +3275,7 @@ gfc_conv_intrinsic_si_kind (gfc_se * se, gfc_expr * expr) args = gfc_conv_intrinsic_function_args (se, expr); args = TREE_VALUE (args); args = build_fold_addr_expr (args); - args = tree_cons (NULL_TREE, args, NULL_TREE); - se->expr = build_function_call_expr (gfor_fndecl_si_kind, args); + se->expr = build_call_expr (gfor_fndecl_si_kind, 1, args); } /* Generate code for SELECTED_REAL_KIND (P, R) intrinsic function. */ @@ -3351,8 +3338,7 @@ gfc_conv_intrinsic_trim (gfc_se * se, gfc_expr * expr) /* Free the temporary afterwards, if necessary. */ cond = build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); - arglist = gfc_chainon_list (NULL_TREE, var); - tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, var); tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); gfc_add_expr_to_block (&se->post, tmp); @@ -3370,7 +3356,6 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr) tree tmp; tree len; tree args; - tree arglist; tree ncopies; tree var; tree type; @@ -3395,12 +3380,9 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr) var = gfc_conv_string_tmp (se, build_pointer_type (type), len); /* Create the argument list and generate the function call. */ - arglist = NULL_TREE; - arglist = gfc_chainon_list (arglist, var); - arglist = gfc_chainon_list (arglist, TREE_VALUE (args)); - arglist = gfc_chainon_list (arglist, TREE_VALUE (TREE_CHAIN (args))); - arglist = gfc_chainon_list (arglist, ncopies); - tmp = build_function_call_expr (gfor_fndecl_string_repeat, arglist); + tmp = build_call_expr (gfor_fndecl_string_repeat, 4, var, + TREE_VALUE (args), + TREE_VALUE (TREE_CHAIN (args)), ncopies); gfc_add_expr_to_block (&se->pre, tmp); se->expr = var; @@ -3419,7 +3401,7 @@ gfc_conv_intrinsic_iargc (gfc_se * se, gfc_expr * expr) /* Call the library function. This always returns an INTEGER(4). */ fndecl = gfor_fndecl_iargc; - tmp = build_function_call_expr (fndecl, NULL_TREE); + tmp = build_call_expr (fndecl, 0); /* Convert it to the required type. */ type = gfc_typenode_for_spec (&expr->ts); diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index 9865f44..951d465 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -835,8 +835,7 @@ gfc_trans_open (gfc_code * code) set_parameter_const (&block, var, IOPARM_common_flags, mask); tmp = build_fold_addr_expr (var); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (iocall[IOCALL_OPEN], tmp); + tmp = build_call_expr (iocall[IOCALL_OPEN], 1, tmp); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &post_block); @@ -888,8 +887,7 @@ gfc_trans_close (gfc_code * code) set_parameter_const (&block, var, IOPARM_common_flags, mask); tmp = build_fold_addr_expr (var); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (iocall[IOCALL_CLOSE], tmp); + tmp = build_call_expr (iocall[IOCALL_CLOSE], 1, tmp); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &post_block); @@ -939,8 +937,7 @@ build_filepos (tree function, gfc_code * code) set_parameter_const (&block, var, IOPARM_common_flags, mask); tmp = build_fold_addr_expr (var); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (function, tmp); + tmp = build_call_expr (function, 1, tmp); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &post_block); @@ -1125,8 +1122,7 @@ gfc_trans_inquire (gfc_code * code) set_parameter_const (&block, var, IOPARM_common_flags, mask); tmp = build_fold_addr_expr (var); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (iocall[IOCALL_INQUIRE], tmp); + tmp = build_call_expr (iocall[IOCALL_INQUIRE], 1, tmp); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &post_block); @@ -1248,8 +1244,6 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c, call to iocall[IOCALL_SET_NML_VAL]. For derived type variable, recursively generate calls to iocall[IOCALL_SET_NML_VAL] for each component. */ -#define NML_FIRST_ARG(a) args = gfc_chainon_list (NULL_TREE, a) -#define NML_ADD_ARG(a) args = gfc_chainon_list (args, a) #define IARG(i) build_int_cst (gfc_array_index_type, i) static void @@ -1263,7 +1257,6 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name, tree dt = NULL; tree string; tree tmp; - tree args; tree dtype; tree dt_parm_addr; int n_dim; @@ -1329,18 +1322,14 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name, (address, name, type, kind or string_length, dtype) */ dt_parm_addr = build_fold_addr_expr (dt_parm); - NML_FIRST_ARG (dt_parm_addr); - NML_ADD_ARG (addr_expr); - NML_ADD_ARG (string); - NML_ADD_ARG (IARG (ts->kind)); if (ts->type == BT_CHARACTER) - NML_ADD_ARG (ts->cl->backend_decl); + tmp = ts->cl->backend_decl; else - NML_ADD_ARG (build_int_cst (gfc_charlen_type_node, 0)); - - NML_ADD_ARG (dtype); - tmp = build_function_call_expr (iocall[IOCALL_SET_NML_VAL], args); + tmp = build_int_cst (gfc_charlen_type_node, 0); + tmp = build_call_expr (iocall[IOCALL_SET_NML_VAL], 6, + dt_parm_addr, addr_expr, string, + IARG (ts->kind), tmp, dtype); gfc_add_expr_to_block (block, tmp); /* If the object is an array, transfer rank times: @@ -1348,12 +1337,12 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name, for ( n_dim = 0 ; n_dim < rank ; n_dim++ ) { - NML_FIRST_ARG (dt_parm_addr); - NML_ADD_ARG (IARG (n_dim)); - NML_ADD_ARG (GFC_TYPE_ARRAY_STRIDE (dt, n_dim)); - NML_ADD_ARG (GFC_TYPE_ARRAY_LBOUND (dt, n_dim)); - NML_ADD_ARG (GFC_TYPE_ARRAY_UBOUND (dt, n_dim)); - tmp = build_function_call_expr (iocall[IOCALL_SET_NML_VAL_DIM], args); + tmp = build_call_expr (iocall[IOCALL_SET_NML_VAL_DIM], 5, + dt_parm_addr, + IARG (n_dim), + GFC_TYPE_ARRAY_STRIDE (dt, n_dim), + GFC_TYPE_ARRAY_LBOUND (dt, n_dim), + GFC_TYPE_ARRAY_UBOUND (dt, n_dim)); gfc_add_expr_to_block (block, tmp); } @@ -1377,8 +1366,6 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name, } #undef IARG -#undef NML_ADD_ARG -#undef NML_FIRST_ARG /* Create a data transfer statement. Not all of the fields are valid for both reading and writing, but improper use has been filtered @@ -1509,8 +1496,7 @@ build_dt (tree function, gfc_code * code) set_parameter_const (&block, var, IOPARM_common_flags, mask); tmp = build_fold_addr_expr (var); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (function, tmp); + tmp = build_call_expr (function, 1, tmp); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &post_block); @@ -1590,8 +1576,7 @@ gfc_trans_dt_end (gfc_code * code) } tmp = build_fold_addr_expr (dt_parm); - tmp = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (function, tmp); + tmp = build_call_expr (function, 1, tmp); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, dt_post_end_block); gfc_init_block (dt_post_end_block); @@ -1702,7 +1687,7 @@ transfer_array_component (tree expr, gfc_component * cm) static void transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr) { - tree args, tmp, function, arg2, field, expr; + tree tmp, function, arg2, field, expr; gfc_component *c; int kind; @@ -1777,11 +1762,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr) } tmp = build_fold_addr_expr (dt_parm); - args = gfc_chainon_list (NULL_TREE, tmp); - args = gfc_chainon_list (args, addr_expr); - args = gfc_chainon_list (args, arg2); - - tmp = build_function_call_expr (function, args); + tmp = build_call_expr (function, 3, tmp, addr_expr, arg2); gfc_add_expr_to_block (&se->pre, tmp); gfc_add_block_to_block (&se->pre, &se->post); @@ -1794,7 +1775,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr) static void transfer_array_desc (gfc_se * se, gfc_typespec * ts, tree addr_expr) { - tree args, tmp, charlen_arg, kind_arg; + tree tmp, charlen_arg, kind_arg; if (ts->type == BT_CHARACTER) charlen_arg = se->string_length; @@ -1804,11 +1785,8 @@ transfer_array_desc (gfc_se * se, gfc_typespec * ts, tree addr_expr) kind_arg = build_int_cst (NULL_TREE, ts->kind); tmp = build_fold_addr_expr (dt_parm); - args = gfc_chainon_list (NULL_TREE, tmp); - args = gfc_chainon_list (args, addr_expr); - args = gfc_chainon_list (args, kind_arg); - args = gfc_chainon_list (args, charlen_arg); - tmp = build_function_call_expr (iocall[IOCALL_X_ARRAY], args); + tmp = build_call_expr (iocall[IOCALL_X_ARRAY], 4, + tmp, addr_expr, kind_arg, charlen_arg); gfc_add_expr_to_block (&se->pre, tmp); gfc_add_block_to_block (&se->pre, &se->post); } diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 8276316..49368661 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -875,7 +875,7 @@ static tree gfc_trans_omp_barrier (void) { tree decl = built_in_decls [BUILT_IN_GOMP_BARRIER]; - return build_function_call_expr (decl, NULL); + return build_call_expr (decl, 0); } static tree @@ -1054,7 +1054,7 @@ static tree gfc_trans_omp_flush (void) { tree decl = built_in_decls [BUILT_IN_SYNCHRONIZE]; - return build_function_call_expr (decl, NULL); + return build_call_expr (decl, 0); } static tree diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 6b8a9a0..cdc8dc6 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -295,9 +295,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse, gfc_add_modify_expr (&se->pre, info->offset, offset); /* Copy the result back using unpack. */ - tmp = gfc_chainon_list (NULL_TREE, parmse.expr); - tmp = gfc_chainon_list (tmp, data); - tmp = build_function_call_expr (gfor_fndecl_in_unpack, tmp); + tmp = build_call_expr (gfor_fndecl_in_unpack, 2, parmse.expr, data); gfc_add_expr_to_block (&se->post, tmp); gfc_add_block_to_block (&se->post, &parmse.post); @@ -470,9 +468,7 @@ gfc_trans_pause (gfc_code * code) { tree gfc_int4_type_node = gfc_get_int_type (4); gfc_se se; - tree args; tree tmp; - tree fndecl; /* Start a new block for this statement. */ gfc_init_se (&se, NULL); @@ -482,18 +478,15 @@ gfc_trans_pause (gfc_code * code) if (code->expr == NULL) { tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code); - args = gfc_chainon_list (NULL_TREE, tmp); - fndecl = gfor_fndecl_pause_numeric; + tmp = build_call_expr (gfor_fndecl_pause_numeric, 1, tmp); } else { gfc_conv_expr_reference (&se, code->expr); - args = gfc_chainon_list (NULL_TREE, se.expr); - args = gfc_chainon_list (args, se.string_length); - fndecl = gfor_fndecl_pause_string; + tmp = build_call_expr (gfor_fndecl_pause_string, 2, + se.expr, se.string_length); } - tmp = build_function_call_expr (fndecl, args); gfc_add_expr_to_block (&se.pre, tmp); gfc_add_block_to_block (&se.pre, &se.post); @@ -510,9 +503,7 @@ gfc_trans_stop (gfc_code * code) { tree gfc_int4_type_node = gfc_get_int_type (4); gfc_se se; - tree args; tree tmp; - tree fndecl; /* Start a new block for this statement. */ gfc_init_se (&se, NULL); @@ -522,18 +513,15 @@ gfc_trans_stop (gfc_code * code) if (code->expr == NULL) { tmp = build_int_cst (gfc_int4_type_node, code->ext.stop_code); - args = gfc_chainon_list (NULL_TREE, tmp); - fndecl = gfor_fndecl_stop_numeric; + tmp = build_call_expr (gfor_fndecl_stop_numeric, 1, tmp); } else { gfc_conv_expr_reference (&se, code->expr); - args = gfc_chainon_list (NULL_TREE, se.expr); - args = gfc_chainon_list (args, se.string_length); - fndecl = gfor_fndecl_stop_string; + tmp = build_call_expr (gfor_fndecl_stop_string, 2, + se.expr, se.string_length); } - tmp = build_function_call_expr (fndecl, args); gfc_add_expr_to_block (&se.pre, tmp); gfc_add_block_to_block (&se.pre, &se.post); @@ -1308,7 +1296,7 @@ gfc_trans_logical_select (gfc_code * code) static tree gfc_trans_character_select (gfc_code *code) { - tree init, node, end_label, tmp, type, args, *labels; + tree init, node, end_label, tmp, type, *labels; tree case_label; stmtblock_t block, body; gfc_case *cp, *d; @@ -1449,25 +1437,19 @@ gfc_trans_character_select (gfc_code *code) DECL_INITIAL (tmp) = init; init = tmp; - /* Build an argument list for the library call */ + /* Build the library call */ init = gfc_build_addr_expr (pvoid_type_node, init); - args = gfc_chainon_list (NULL_TREE, init); - - tmp = build_int_cst (NULL_TREE, n); - args = gfc_chainon_list (args, tmp); - tmp = gfc_build_addr_expr (pvoid_type_node, end_label); - args = gfc_chainon_list (args, tmp); gfc_init_se (&se, NULL); gfc_conv_expr_reference (&se, code->expr); - args = gfc_chainon_list (args, se.expr); - args = gfc_chainon_list (args, se.string_length); - gfc_add_block_to_block (&block, &se.pre); - tmp = build_function_call_expr (gfor_fndecl_select_string, args); + tmp = build_call_expr (gfor_fndecl_select_string, 5, + init, build_int_cst (NULL_TREE, n), + tmp, se.expr, se.string_length); + case_label = gfc_create_var (TREE_TYPE (tmp), "case_label"); gfc_add_modify_expr (&block, case_label, tmp); @@ -1687,7 +1669,6 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock, tree tmpvar; tree type; tree tmp; - tree args; if (INTEGER_CST_P (size)) { @@ -1710,14 +1691,13 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock, tmpvar = gfc_create_var (build_pointer_type (type), "temp"); *pdata = convert (pvoid_type_node, tmpvar); - args = gfc_chainon_list (NULL_TREE, bytesize); if (gfc_index_integer_kind == 4) tmp = gfor_fndecl_internal_malloc; else if (gfc_index_integer_kind == 8) tmp = gfor_fndecl_internal_malloc64; else gcc_unreachable (); - tmp = build_function_call_expr (tmp, args); + tmp = build_call_expr (tmp, 1, bytesize); tmp = convert (TREE_TYPE (tmpvar), tmp); gfc_add_modify_expr (pblock, tmpvar, tmp); } @@ -2229,8 +2209,7 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, if (ptemp1) { /* Free the temporary. */ - tmp = gfc_chainon_list (NULL_TREE, ptemp1); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, ptemp1); gfc_add_expr_to_block (block, tmp); } } @@ -2388,8 +2367,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, /* Free the temporary. */ if (ptemp1) { - tmp = gfc_chainon_list (NULL_TREE, ptemp1); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, ptemp1); gfc_add_expr_to_block (block, tmp); } } @@ -2724,8 +2702,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) if (pmask) { /* Free the temporary for the mask. */ - tmp = gfc_chainon_list (NULL_TREE, pmask); - tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, pmask); gfc_add_expr_to_block (&block, tmp); } if (maskindex) @@ -3322,16 +3299,14 @@ gfc_trans_where_2 (gfc_code * code, tree mask, bool invert, /* If we allocated a pending mask array, deallocate it now. */ if (ppmask) { - tree args = gfc_chainon_list (NULL_TREE, ppmask); - tmp = build_function_call_expr (gfor_fndecl_internal_free, args); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, ppmask); gfc_add_expr_to_block (block, tmp); } /* If we allocated a current mask array, deallocate it now. */ if (pcmask) { - tree args = gfc_chainon_list (NULL_TREE, pcmask); - tmp = build_function_call_expr (gfor_fndecl_internal_free, args); + tmp = build_call_expr (gfor_fndecl_internal_free, 1, pcmask); gfc_add_expr_to_block (block, tmp); } } @@ -3617,9 +3592,7 @@ gfc_trans_allocate (gfc_code * code) if (expr->ts.type == BT_CHARACTER && tmp == NULL_TREE) tmp = se.string_length; - parm = gfc_chainon_list (NULL_TREE, tmp); - parm = gfc_chainon_list (parm, pstat); - tmp = build_function_call_expr (gfor_fndecl_allocate, parm); + tmp = build_call_expr (gfor_fndecl_allocate, 2, tmp, pstat); tmp = build2 (MODIFY_EXPR, void_type_node, se.expr, tmp); gfc_add_expr_to_block (&se.pre, tmp); @@ -3685,7 +3658,7 @@ gfc_trans_deallocate (gfc_code * code) gfc_se se; gfc_alloc *al; gfc_expr *expr; - tree apstat, astat, parm, pstat, stat, tmp; + tree apstat, astat, pstat, stat, tmp; stmtblock_t block; gfc_start_block (&block); @@ -3748,9 +3721,7 @@ gfc_trans_deallocate (gfc_code * code) tmp = gfc_array_deallocate (se.expr, pstat); else { - parm = gfc_chainon_list (NULL_TREE, se.expr); - parm = gfc_chainon_list (parm, pstat); - tmp = build_function_call_expr (gfor_fndecl_deallocate, parm); + tmp = build_call_expr (gfor_fndecl_deallocate, 2, se.expr, pstat); gfc_add_expr_to_block (&se.pre, tmp); tmp = build2 (MODIFY_EXPR, void_type_node, diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index d942ebd..59b2dec 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -318,7 +318,7 @@ gfc_trans_runtime_check (tree cond, const char * msgid, stmtblock_t * pblock, stmtblock_t block; tree body; tree tmp; - tree args; + tree arg; char * message; int line; @@ -342,11 +342,10 @@ gfc_trans_runtime_check (tree cond, const char * msgid, stmtblock_t * pblock, asprintf (&message, "%s (in file '%s', around line %d)", _(msgid), gfc_source_file, input_line + 1); - tmp = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const(message)); + arg = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const(message)); gfc_free(message); - args = gfc_chainon_list (NULL_TREE, tmp); - tmp = build_function_call_expr (gfor_fndecl_runtime_error, args); + tmp = build_call_expr (gfor_fndecl_runtime_error, 1, arg); gfc_add_expr_to_block (&block, tmp); body = gfc_finish_block (&block); @@ -359,9 +358,8 @@ gfc_trans_runtime_check (tree cond, const char * msgid, stmtblock_t * pblock, { /* Tell the compiler that this isn't likely. */ cond = fold_convert (long_integer_type_node, cond); - tmp = gfc_chainon_list (NULL_TREE, cond); - tmp = gfc_chainon_list (tmp, build_int_cst (long_integer_type_node, 0)); - cond = build_function_call_expr (built_in_decls[BUILT_IN_EXPECT], tmp); + tmp = build_int_cst (long_integer_type_node, 0); + cond = build_call_expr (built_in_decls[BUILT_IN_EXPECT], 2, cond, tmp); cond = fold_convert (boolean_type_node, cond); tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt ()); |