summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog66
-rw-r--r--gcc/fortran/trans-array.c30
-rw-r--r--gcc/fortran/trans-decl.c8
-rw-r--r--gcc/fortran/trans-expr.c12
-rw-r--r--gcc/fortran/trans-intrinsic.c54
-rw-r--r--gcc/fortran/trans-io.c20
-rw-r--r--gcc/fortran/trans-stmt.c22
-rw-r--r--gcc/fortran/trans.c22
-rw-r--r--gcc/fortran/trans.h3
9 files changed, 141 insertions, 96 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 298b67260f1..d23f6b0dfe9 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,71 @@
2005-12-16 Richard Guenther <rguenther@suse.de>
+ * trans.h (tree): Remove declaration of gfc_build_function_call.
+ * trans.c (gfc_build_function_call): Remove.
+ (gfc_build_array_ref): Use build_function_call_expr.
+ (gfc_trans_runtime_check): Likewise.
+ * trans-array.c (gfc_trans_allocate_array_storage): Likewise.
+ (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.
+ * trans-expr.c (gfc_conv_power_op): Likewise.
+ (gfc_conv_string_tmp): Likewise.
+ (gfc_conv_concat_op): Likewise.
+ (gfc_conv_expr_op): Likewise.
+ (gfc_trans_string_copy): Likewise.
+ * trans-decl.c (build_entry_thunks): Likewise.
+ (gfc_generate_function_code): Likewise.
+ (gfc_generate_constructors): Likewise.
+ * trans-io.c (gfc_trans_open): Likewise.
+ (gfc_trans_close): Likewise.
+ (build_filepos): Likewise.
+ (gfc_trans_inquire): Likewise.
+ (transfer_namelist_element): Likewise.
+ (build_dt): Likewise.
+ (gfc_trans_dt_end): Likewise.
+ (transfer_expr): Likewise.
+ (transfer_array_desc): Likewise.
+ * trans-stmt.c (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): Likewise.
+ (gfc_trans_allocate): Likewise.
+ (gfc_trans_deallocate): Likewise.
+ * trans-intrinsic.c (gfc_conv_intrinsic_aint): Likewise.
+ (gfc_conv_intrinsic_lib_function): Likewise.
+ (gfc_conv_intrinsic_exponent): Likewise.
+ (gfc_conv_intrinsic_abs): Likewise.
+ (gfc_conv_intrinsic_sign): Likewise.
+ (gfc_conv_intrinsic_ctime): Likewise.
+ (gfc_conv_intrinsic_fdate): Likewise.
+ (gfc_conv_intrinsic_ttynam): Likewise.
+ (gfc_conv_intrinsic_ishftc): Likewise.
+ (gfc_conv_intrinsic_len_trim): Likewise.
+ (gfc_conv_intrinsic_index): Likewise.
+ (gfc_conv_intrinsic_size): Likewise.
+ (gfc_conv_intrinsic_strcmp): Likewise.
+ (gfc_conv_intrinsic_adjust): Likewise.
+ (gfc_conv_associated): Likewise.
+ (gfc_conv_intrinsic_scan): Likewise.
+ (gfc_conv_intrinsic_verify): Likewise.
+ (call_builtin_clz): Likewise.
+ (gfc_conv_intrinsic_si_kind): Likewise.
+ (gfc_conv_intrinsic_sr_kind): Likewise.
+ (gfc_conv_intrinsic_trim): Likewise.
+ (gfc_conv_intrinsic_repeat): Likewise.
+ (gfc_conv_intrinsic_iargc): Likewise.
+
+2005-12-16 Richard Guenther <rguenther@suse.de>
+
* trans.h (gfc_build_indirect_ref): Remove declaration.
* trans.c (gfc_build_indirect_ref): Remove.
* trans-array.c (gfc_trans_array_ctor_element): Use
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 2ecbc502d52..e943d8ec103 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -533,7 +533,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
tmp = gfor_fndecl_internal_malloc64;
else
gcc_unreachable ();
- tmp = gfc_build_function_call (tmp, args);
+ tmp = build_function_call_expr (tmp, args);
tmp = gfc_evaluate_now (tmp, pre);
gfc_conv_descriptor_data_set (pre, desc, tmp);
}
@@ -551,7 +551,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
tmp = gfc_conv_descriptor_data_get (desc);
tmp = fold_convert (pvoid_type_node, tmp);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp);
gfc_add_expr_to_block (post, tmp);
}
}
@@ -818,7 +818,7 @@ gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra)
gcc_unreachable ();
/* Set the new data pointer. */
- tmp = gfc_build_function_call (tmp, args);
+ tmp = build_function_call_expr (tmp, args);
gfc_conv_descriptor_data_set (pblock, desc, tmp);
}
@@ -953,7 +953,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
args = gfc_chainon_list (args, se->expr);
args = gfc_chainon_list (args, se->string_length);
tmp = built_in_decls[BUILT_IN_MEMCPY];
- tmp = gfc_build_function_call (tmp, args);
+ tmp = build_function_call_expr (tmp, args);
gfc_add_expr_to_block (&se->pre, tmp);
}
}
@@ -1167,7 +1167,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
tmp = gfc_chainon_list (NULL_TREE, tmp);
tmp = gfc_chainon_list (tmp, init);
tmp = gfc_chainon_list (tmp, bound);
- tmp = gfc_build_function_call (built_in_decls[BUILT_IN_MEMCPY],
+ tmp = build_function_call_expr (built_in_decls[BUILT_IN_MEMCPY],
tmp);
gfc_add_expr_to_block (&body, tmp);
@@ -3049,7 +3049,7 @@ gfc_array_allocate (gfc_se * se, gfc_ref * ref, tree pstat)
tmp = gfc_chainon_list (NULL_TREE, pointer);
tmp = gfc_chainon_list (tmp, size);
tmp = gfc_chainon_list (tmp, pstat);
- tmp = gfc_build_function_call (allocate, tmp);
+ tmp = build_function_call_expr (allocate, tmp);
gfc_add_expr_to_block (&se->pre, tmp);
tmp = gfc_conv_descriptor_offset (se->expr);
@@ -3076,7 +3076,7 @@ gfc_array_deallocate (tree descriptor, tree pstat)
/* Parameter is the address of the data component. */
tmp = gfc_chainon_list (NULL_TREE, var);
tmp = gfc_chainon_list (tmp, pstat);
- tmp = gfc_build_function_call (gfor_fndecl_deallocate, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_deallocate, tmp);
gfc_add_expr_to_block (&block, tmp);
return gfc_finish_block (&block);
@@ -3355,7 +3355,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
fndecl = gfor_fndecl_internal_malloc64;
else
gcc_unreachable ();
- tmp = gfc_build_function_call (fndecl, tmp);
+ tmp = build_function_call_expr (fndecl, tmp);
tmp = fold (convert (TREE_TYPE (decl), tmp));
gfc_add_modify_expr (&block, decl, tmp);
@@ -3372,7 +3372,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 = gfc_build_function_call (gfor_fndecl_internal_free, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp);
gfc_add_expr_to_block (&block, tmp);
return gfc_finish_block (&block);
@@ -3533,7 +3533,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
/* A library call to repack the array if necessary. */
tmp = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- stmt_unpacked = gfc_build_function_call (gfor_fndecl_in_pack, tmp);
+ stmt_unpacked = build_function_call_expr (gfor_fndecl_in_pack, tmp);
stride = gfc_index_one_node;
}
@@ -3695,13 +3695,13 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
/* Copy the data back. */
tmp = gfc_chainon_list (NULL_TREE, dumdesc);
tmp = gfc_chainon_list (tmp, tmpdesc);
- tmp = gfc_build_function_call (gfor_fndecl_in_unpack, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_in_unpack, tmp);
gfc_add_expr_to_block (&cleanup, tmp);
}
/* Free the temporary. */
tmp = gfc_chainon_list (NULL_TREE, tmpdesc);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp);
gfc_add_expr_to_block (&cleanup, tmp);
stmt = gfc_finish_block (&cleanup);
@@ -4205,7 +4205,7 @@ 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 = gfc_build_function_call (gfor_fndecl_in_pack, tmp);
+ ptr = build_function_call_expr (gfor_fndecl_in_pack, tmp);
ptr = gfc_evaluate_now (ptr, &se->pre);
se->expr = ptr;
@@ -4214,13 +4214,13 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
/* Copy the data back. */
tmp = gfc_chainon_list (NULL_TREE, desc);
tmp = gfc_chainon_list (tmp, ptr);
- tmp = gfc_build_function_call (gfor_fndecl_in_unpack, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_in_unpack, tmp);
gfc_add_expr_to_block (&block, tmp);
/* Free the temporary. */
tmp = convert (pvoid_type_node, ptr);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp);
gfc_add_expr_to_block (&block, tmp);
stmt = gfc_finish_block (&block);
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 53d9225dc25..b3f153bad2b 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1545,7 +1545,7 @@ build_entry_thunks (gfc_namespace * ns)
args = nreverse (args);
args = chainon (args, nreverse (string_args));
tmp = ns->proc_name->backend_decl;
- tmp = gfc_build_function_call (tmp, args);
+ tmp = build_function_call_expr (tmp, args);
if (ns->proc_name->attr.mixed_entry_master)
{
tree union_decl, field;
@@ -2602,7 +2602,7 @@ gfc_generate_function_code (gfc_namespace * ns)
arglist = gfc_chainon_list (arglist,
build_int_cst (gfc_int4_type_node,
gfc_option.allow_std));
- tmp = gfc_build_function_call (gfor_fndecl_set_std, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_set_std, arglist);
gfc_add_expr_to_block (&body, tmp);
}
@@ -2617,7 +2617,7 @@ gfc_generate_function_code (gfc_namespace * ns)
arglist = gfc_chainon_list (NULL_TREE,
build_int_cst (gfc_c_int_type_node,
gfc_option.fpe));
- tmp = gfc_build_function_call (gfor_fndecl_set_fpe, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_set_fpe, arglist);
gfc_add_expr_to_block (&body, tmp);
}
@@ -2764,7 +2764,7 @@ gfc_generate_constructors (void)
for (; gfc_static_ctors; gfc_static_ctors = TREE_CHAIN (gfc_static_ctors))
{
tmp =
- gfc_build_function_call (TREE_VALUE (gfc_static_ctors), NULL_TREE);
+ build_function_call_expr (TREE_VALUE (gfc_static_ctors), NULL_TREE);
DECL_SAVED_TREE (fndecl) = build_stmt (EXPR_STMT, tmp);
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index bbda8941b78..f21c0734290 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -798,7 +798,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
tmp = gfc_chainon_list (NULL_TREE, lse.expr);
tmp = gfc_chainon_list (tmp, rse.expr);
- se->expr = fold (gfc_build_function_call (fndecl, tmp));
+ se->expr = build_function_call_expr (fndecl, tmp);
}
@@ -828,14 +828,14 @@ 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 = gfc_build_function_call (gfor_fndecl_internal_malloc, args);
+ tmp = build_function_call_expr (gfor_fndecl_internal_malloc, args);
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 = gfc_build_function_call (gfor_fndecl_internal_free, args);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, args);
gfc_add_expr_to_block (&se->post, tmp);
}
@@ -890,7 +890,7 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr)
args = gfc_chainon_list (args, lse.expr);
args = gfc_chainon_list (args, rse.string_length);
args = gfc_chainon_list (args, rse.expr);
- tmp = gfc_build_function_call (gfor_fndecl_concat_string, args);
+ tmp = build_function_call_expr (gfor_fndecl_concat_string, args);
gfc_add_expr_to_block (&se->pre, tmp);
/* Add the cleanup for the operands. */
@@ -1056,7 +1056,7 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
tmp = gfc_chainon_list (tmp, rse.expr);
/* Build a call for the comparison. */
- lse.expr = gfc_build_function_call (gfor_fndecl_compare_string, tmp);
+ lse.expr = build_function_call_expr (gfor_fndecl_compare_string, tmp);
gfc_add_block_to_block (&lse.post, &rse.post);
rse.expr = integer_zero_node;
@@ -1824,7 +1824,7 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlen, tree dest,
tmp = gfc_chainon_list (tmp, dest);
tmp = gfc_chainon_list (tmp, slen);
tmp = gfc_chainon_list (tmp, src);
- tmp = gfc_build_function_call (gfor_fndecl_copy_string, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_copy_string, tmp);
gfc_add_expr_to_block (block, tmp);
}
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 9be6448f32d..e3f4bdf6cdf 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -387,7 +387,7 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum tree_code op)
if (n != END_BUILTINS)
{
tmp = built_in_decls[n];
- se->expr = gfc_build_function_call (tmp, arg);
+ se->expr = build_function_call_expr (tmp, arg);
return;
}
@@ -641,7 +641,7 @@ gfc_conv_intrinsic_lib_function (gfc_se * se, gfc_expr * expr)
/* Get the decl and generate the call. */
args = gfc_conv_intrinsic_function_args (se, expr);
fndecl = gfc_get_intrinsic_lib_fndecl (m, expr);
- se->expr = gfc_build_function_call (fndecl, args);
+ se->expr = build_function_call_expr (fndecl, args);
}
/* Generate code for EXPONENT(X) intrinsic function. */
@@ -673,7 +673,7 @@ gfc_conv_intrinsic_exponent (gfc_se * se, gfc_expr * expr)
gcc_unreachable ();
}
- se->expr = gfc_build_function_call (fndecl, args);
+ se->expr = build_function_call_expr (fndecl, args);
}
/* Evaluate a single upper or lower bound. */
@@ -795,7 +795,7 @@ gfc_conv_intrinsic_abs (gfc_se * se, gfc_expr * expr)
default:
gcc_unreachable ();
}
- se->expr = fold (gfc_build_function_call (built_in_decls[n], args));
+ se->expr = build_function_call_expr (built_in_decls[n], args);
break;
default:
@@ -961,7 +961,7 @@ gfc_conv_intrinsic_sign (gfc_se * se, gfc_expr * expr)
default:
gcc_unreachable ();
}
- se->expr = fold (gfc_build_function_call (tmp, arg));
+ se->expr = build_function_call_expr (tmp, arg);
return;
}
@@ -1057,14 +1057,14 @@ gfc_conv_intrinsic_ctime (gfc_se * se, gfc_expr * expr)
arglist = gfc_chainon_list (arglist, build_fold_addr_expr (len));
arglist = chainon (arglist, tmp);
- tmp = gfc_build_function_call (gfor_fndecl_ctime, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_ctime, arglist);
gfc_add_expr_to_block (&se->pre, tmp);
/* 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 = gfc_build_function_call (gfor_fndecl_internal_free, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
@@ -1093,14 +1093,14 @@ gfc_conv_intrinsic_fdate (gfc_se * se, gfc_expr * expr)
arglist = gfc_chainon_list (arglist, build_fold_addr_expr (len));
arglist = chainon (arglist, tmp);
- tmp = gfc_build_function_call (gfor_fndecl_fdate, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_fdate, arglist);
gfc_add_expr_to_block (&se->pre, tmp);
/* 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 = gfc_build_function_call (gfor_fndecl_internal_free, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
@@ -1131,14 +1131,14 @@ gfc_conv_intrinsic_ttynam (gfc_se * se, gfc_expr * expr)
arglist = gfc_chainon_list (arglist, build_fold_addr_expr (len));
arglist = chainon (arglist, tmp);
- tmp = gfc_build_function_call (gfor_fndecl_ttynam, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_ttynam, arglist);
gfc_add_expr_to_block (&se->pre, tmp);
/* 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 = gfc_build_function_call (gfor_fndecl_internal_free, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
@@ -2039,7 +2039,7 @@ gfc_conv_intrinsic_ishftc (gfc_se * se, gfc_expr * expr)
default:
gcc_unreachable ();
}
- se->expr = gfc_build_function_call (tmp, arg);
+ se->expr = build_function_call_expr (tmp, arg);
/* Convert the result back to the original type, if we extended
the first argument's width above. */
if (expr->ts.kind < 4)
@@ -2129,7 +2129,7 @@ gfc_conv_intrinsic_len_trim (gfc_se * se, gfc_expr * expr)
args = gfc_conv_intrinsic_function_args (se, expr);
type = gfc_typenode_for_spec (&expr->ts);
- se->expr = gfc_build_function_call (gfor_fndecl_string_len_trim, args);
+ se->expr = build_function_call_expr (gfor_fndecl_string_len_trim, args);
se->expr = convert (type, se->expr);
}
@@ -2160,7 +2160,7 @@ gfc_conv_intrinsic_index (gfc_se * se, gfc_expr * expr)
TREE_VALUE (back) = convert (logical4_type_node, TREE_VALUE (back));
}
- se->expr = gfc_build_function_call (gfor_fndecl_string_index, args);
+ se->expr = build_function_call_expr (gfor_fndecl_string_index, args);
se->expr = convert (type, se->expr);
}
@@ -2254,7 +2254,7 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr)
else
fndecl = gfor_fndecl_size0;
- se->expr = gfc_build_function_call (fndecl, args);
+ se->expr = build_function_call_expr (fndecl, args);
type = gfc_typenode_for_spec (&expr->ts);
se->expr = convert (type, se->expr);
}
@@ -2270,7 +2270,7 @@ gfc_conv_intrinsic_strcmp (gfc_se * se, gfc_expr * expr, int op)
args = gfc_conv_intrinsic_function_args (se, expr);
/* Build a call for the comparison. */
- se->expr = gfc_build_function_call (gfor_fndecl_compare_string, args);
+ se->expr = build_function_call_expr (gfor_fndecl_compare_string, args);
type = gfc_typenode_for_spec (&expr->ts);
se->expr = build2 (op, type, se->expr,
@@ -2294,7 +2294,7 @@ gfc_conv_intrinsic_adjust (gfc_se * se, gfc_expr * expr, tree fndecl)
var = gfc_conv_string_tmp (se, type, len);
args = tree_cons (NULL_TREE, var, args);
- tmp = gfc_build_function_call (fndecl, args);
+ tmp = build_function_call_expr (fndecl, args);
gfc_add_expr_to_block (&se->pre, tmp);
se->expr = var;
se->string_length = len;
@@ -2444,7 +2444,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
gfc_add_block_to_block (&se->post, &arg2se.post);
args = gfc_chainon_list (args, arg2se.expr);
fndecl = gfor_fndecl_associated;
- se->expr = gfc_build_function_call (fndecl, args);
+ se->expr = build_function_call_expr (fndecl, args);
}
}
se->expr = convert (gfc_typenode_for_spec (&expr->ts), se->expr);
@@ -2477,7 +2477,7 @@ gfc_conv_intrinsic_scan (gfc_se * se, gfc_expr * expr)
TREE_VALUE (back) = convert (logical4_type_node, TREE_VALUE (back));
}
- se->expr = gfc_build_function_call (gfor_fndecl_string_scan, args);
+ se->expr = build_function_call_expr (gfor_fndecl_string_scan, args);
se->expr = convert (type, se->expr);
}
@@ -2510,7 +2510,7 @@ gfc_conv_intrinsic_verify (gfc_se * se, gfc_expr * expr)
TREE_VALUE (back) = convert (logical4_type_node, TREE_VALUE (back));
}
- se->expr = gfc_build_function_call (gfor_fndecl_string_verify, args);
+ se->expr = build_function_call_expr (gfor_fndecl_string_verify, args);
se->expr = convert (type, se->expr);
}
@@ -2601,7 +2601,7 @@ call_builtin_clz (tree result_type, tree op0)
gcc_unreachable ();
parms = tree_cons (NULL, op0, NULL);
- call = gfc_build_function_call (fn, parms);
+ call = build_function_call_expr (fn, parms);
return convert (result_type, call);
}
@@ -2723,7 +2723,7 @@ gfc_conv_intrinsic_si_kind (gfc_se * se, gfc_expr * expr)
args = TREE_VALUE (args);
args = build_fold_addr_expr (args);
args = tree_cons (NULL_TREE, args, NULL_TREE);
- se->expr = gfc_build_function_call (gfor_fndecl_si_kind, args);
+ se->expr = build_function_call_expr (gfor_fndecl_si_kind, args);
}
/* Generate code for SELECTED_REAL_KIND (P, R) intrinsic function. */
@@ -2750,7 +2750,7 @@ gfc_conv_intrinsic_sr_kind (gfc_se * se, gfc_expr * expr)
gfc_add_block_to_block (&se->post, &argse.post);
args = gfc_chainon_list (args, argse.expr);
}
- se->expr = gfc_build_function_call (gfor_fndecl_sr_kind, args);
+ se->expr = build_function_call_expr (gfor_fndecl_sr_kind, args);
}
@@ -2780,14 +2780,14 @@ gfc_conv_intrinsic_trim (gfc_se * se, gfc_expr * expr)
arglist = gfc_chainon_list (arglist, addr);
arglist = chainon (arglist, tmp);
- tmp = gfc_build_function_call (gfor_fndecl_string_trim, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_string_trim, arglist);
gfc_add_expr_to_block (&se->pre, tmp);
/* 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 = gfc_build_function_call (gfor_fndecl_internal_free, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, arglist);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
@@ -2821,7 +2821,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
arglist = NULL_TREE;
arglist = gfc_chainon_list (arglist, var);
arglist = chainon (arglist, args);
- tmp = gfc_build_function_call (gfor_fndecl_string_repeat, arglist);
+ tmp = build_function_call_expr (gfor_fndecl_string_repeat, arglist);
gfc_add_expr_to_block (&se->pre, tmp);
se->expr = var;
@@ -2840,7 +2840,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 = gfc_build_function_call (fndecl, NULL_TREE);
+ tmp = build_function_call_expr (fndecl, NULL_TREE);
/* 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 82aa5bad9f0..ed6cf9a07e0 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -799,7 +799,7 @@ gfc_trans_open (gfc_code * code)
tmp = build_fold_addr_expr (var);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (iocall[IOCALL_OPEN], tmp);
+ tmp = build_function_call_expr (iocall[IOCALL_OPEN], tmp);
gfc_add_expr_to_block (&block, tmp);
gfc_add_block_to_block (&block, &post_block);
@@ -852,7 +852,7 @@ gfc_trans_close (gfc_code * code)
tmp = build_fold_addr_expr (var);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (iocall[IOCALL_CLOSE], tmp);
+ tmp = build_function_call_expr (iocall[IOCALL_CLOSE], tmp);
gfc_add_expr_to_block (&block, tmp);
gfc_add_block_to_block (&block, &post_block);
@@ -903,7 +903,7 @@ build_filepos (tree function, gfc_code * code)
tmp = build_fold_addr_expr (var);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (function, tmp);
+ tmp = build_function_call_expr (function, tmp);
gfc_add_expr_to_block (&block, tmp);
gfc_add_block_to_block (&block, &post_block);
@@ -1085,7 +1085,7 @@ gfc_trans_inquire (gfc_code * code)
tmp = build_fold_addr_expr (var);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (iocall[IOCALL_INQUIRE], tmp);
+ tmp = build_function_call_expr (iocall[IOCALL_INQUIRE], tmp);
gfc_add_expr_to_block (&block, tmp);
gfc_add_block_to_block (&block, &post_block);
@@ -1299,7 +1299,7 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name,
NML_ADD_ARG (convert (gfc_charlen_type_node, integer_zero_node));
NML_ADD_ARG (dtype);
- tmp = gfc_build_function_call (iocall[IOCALL_SET_NML_VAL], args);
+ tmp = build_function_call_expr (iocall[IOCALL_SET_NML_VAL], args);
gfc_add_expr_to_block (block, tmp);
/* If the object is an array, transfer rank times:
@@ -1312,7 +1312,7 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name,
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 = gfc_build_function_call (iocall[IOCALL_SET_NML_VAL_DIM], args);
+ tmp = build_function_call_expr (iocall[IOCALL_SET_NML_VAL_DIM], args);
gfc_add_expr_to_block (block, tmp);
}
@@ -1467,7 +1467,7 @@ build_dt (tree function, gfc_code * code)
tmp = build_fold_addr_expr (var);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (function, tmp);
+ tmp = build_function_call_expr (function, tmp);
gfc_add_expr_to_block (&block, tmp);
gfc_add_block_to_block (&block, &post_block);
@@ -1546,7 +1546,7 @@ gfc_trans_dt_end (gfc_code * code)
tmp = build_fold_addr_expr (dt_parm);
tmp = gfc_chainon_list (NULL_TREE, tmp);
- tmp = gfc_build_function_call (function, tmp);
+ tmp = build_function_call_expr (function, 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);
@@ -1735,7 +1735,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
args = gfc_chainon_list (args, addr_expr);
args = gfc_chainon_list (args, arg2);
- tmp = gfc_build_function_call (function, args);
+ tmp = build_function_call_expr (function, args);
gfc_add_expr_to_block (&se->pre, tmp);
gfc_add_block_to_block (&se->pre, &se->post);
@@ -1762,7 +1762,7 @@ transfer_array_desc (gfc_se * se, gfc_typespec * ts, tree addr_expr)
args = gfc_chainon_list (args, addr_expr);
args = gfc_chainon_list (args, kind_arg);
args = gfc_chainon_list (args, charlen_arg);
- tmp = gfc_build_function_call (iocall[IOCALL_X_ARRAY], args);
+ tmp = build_function_call_expr (iocall[IOCALL_X_ARRAY], args);
gfc_add_expr_to_block (&se->pre, tmp);
gfc_add_block_to_block (&se->pre, &se->post);
}
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 1fea1dc8f7b..1b56cf478de 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -317,7 +317,7 @@ gfc_trans_pause (gfc_code * code)
fndecl = gfor_fndecl_pause_string;
}
- tmp = gfc_build_function_call (fndecl, args);
+ tmp = build_function_call_expr (fndecl, args);
gfc_add_expr_to_block (&se.pre, tmp);
gfc_add_block_to_block (&se.pre, &se.post);
@@ -357,7 +357,7 @@ gfc_trans_stop (gfc_code * code)
fndecl = gfor_fndecl_stop_string;
}
- tmp = gfc_build_function_call (fndecl, args);
+ tmp = build_function_call_expr (fndecl, args);
gfc_add_expr_to_block (&se.pre, tmp);
gfc_add_block_to_block (&se.pre, &se.post);
@@ -1283,7 +1283,7 @@ gfc_trans_character_select (gfc_code *code)
gfc_add_block_to_block (&block, &se.pre);
- tmp = gfc_build_function_call (gfor_fndecl_select_string, args);
+ tmp = build_function_call_expr (gfor_fndecl_select_string, args);
tmp = build1 (GOTO_EXPR, void_type_node, tmp);
gfc_add_expr_to_block (&block, tmp);
@@ -1534,7 +1534,7 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock,
tmp = gfor_fndecl_internal_malloc64;
else
gcc_unreachable ();
- tmp = gfc_build_function_call (tmp, args);
+ tmp = build_function_call_expr (tmp, args);
tmp = convert (TREE_TYPE (tmpvar), tmp);
gfc_add_modify_expr (pblock, tmpvar, tmp);
}
@@ -2019,7 +2019,7 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, tree wheremask,
{
/* Free the temporary. */
tmp = gfc_chainon_list (NULL_TREE, ptemp1);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp);
gfc_add_expr_to_block (block, tmp);
}
}
@@ -2177,7 +2177,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
if (ptemp1)
{
tmp = gfc_chainon_list (NULL_TREE, ptemp1);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp);
gfc_add_expr_to_block (block, tmp);
}
}
@@ -2468,7 +2468,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
/* Free the temporary. */
args = gfc_chainon_list (NULL_TREE, temp->temporary);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, args);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, args);
gfc_add_expr_to_block (&block, tmp);
p = temp;
@@ -2524,7 +2524,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
{
/* Free the temporary for the mask. */
tmp = gfc_chainon_list (NULL_TREE, pmask);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, tmp);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, tmp);
gfc_add_expr_to_block (&block, tmp);
}
if (maskindex)
@@ -3068,7 +3068,7 @@ gfc_trans_where (gfc_code * code)
while (temp)
{
args = gfc_chainon_list (NULL_TREE, temp->temporary);
- tmp = gfc_build_function_call (gfor_fndecl_internal_free, args);
+ tmp = build_function_call_expr (gfor_fndecl_internal_free, args);
gfc_add_expr_to_block (&block, tmp);
p = temp;
@@ -3185,7 +3185,7 @@ gfc_trans_allocate (gfc_code * code)
parm = gfc_chainon_list (NULL_TREE, val);
parm = gfc_chainon_list (parm, tmp);
parm = gfc_chainon_list (parm, pstat);
- tmp = gfc_build_function_call (gfor_fndecl_allocate, parm);
+ tmp = build_function_call_expr (gfor_fndecl_allocate, parm);
gfc_add_expr_to_block (&se.pre, tmp);
if (code->expr)
@@ -3291,7 +3291,7 @@ gfc_trans_deallocate (gfc_code * code)
parm = gfc_chainon_list (NULL_TREE, var);
parm = gfc_chainon_list (parm, pstat);
- tmp = gfc_build_function_call (gfor_fndecl_deallocate, parm);
+ tmp = build_function_call_expr (gfor_fndecl_deallocate, parm);
}
gfc_add_expr_to_block (&se.pre, tmp);
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 50a78fca305..5c748833a62 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -298,24 +298,6 @@ gfc_build_array_ref (tree base, tree offset)
}
-/* Given a function declaration FNDECL and an argument list ARGLIST,
- build a CALL_EXPR. */
-
-tree
-gfc_build_function_call (tree fndecl, tree arglist)
-{
- tree fn;
- tree call;
-
- fn = gfc_build_addr_expr (NULL, fndecl);
- call = build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (fndecl)),
- fn, arglist, NULL);
- TREE_SIDE_EFFECTS (call) = 1;
-
- return call;
-}
-
-
/* Generate a runtime error if COND is true. */
void
@@ -347,7 +329,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
tmp = build_int_cst (NULL_TREE, input_line);
args = gfc_chainon_list (args, tmp);
- tmp = gfc_build_function_call (gfor_fndecl_runtime_error, args);
+ tmp = build_function_call_expr (gfor_fndecl_runtime_error, args);
gfc_add_expr_to_block (&block, tmp);
body = gfc_finish_block (&block);
@@ -361,7 +343,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
/* Tell the compiler that this isn't likely. */
tmp = gfc_chainon_list (NULL_TREE, cond);
tmp = gfc_chainon_list (tmp, integer_zero_node);
- cond = gfc_build_function_call (built_in_decls[BUILT_IN_EXPECT], tmp);
+ cond = build_function_call_expr (built_in_decls[BUILT_IN_EXPECT], tmp);
tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt ());
gfc_add_expr_to_block (pblock, tmp);
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 9f789ae33c5..2d637bd9406 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -345,9 +345,6 @@ tree gfc_get_extern_function_decl (gfc_symbol *);
/* Return the decl for a function. */
tree gfc_get_function_decl (gfc_symbol *);
-/* Build a CALL_EXPR. */
-tree gfc_build_function_call (tree, tree);
-
/* Build an ADDR_EXPR. */
tree gfc_build_addr_expr (tree, tree);