aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2014-10-09 09:47:25 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2014-10-09 09:47:25 +0000
commit3b7ea188c0457b2e70bdefc8cb53a790e7e9b296 (patch)
tree50e92902ab44fae4fa8b683d332d148d1627916f /gcc/fortran/trans-decl.c
parentf9d29866b5bdf7d42d974dc3f91fb2bd834354db (diff)
downloadgcc-3b7ea188c0457b2e70bdefc8cb53a790e7e9b296.zip
gcc-3b7ea188c0457b2e70bdefc8cb53a790e7e9b296.tar.gz
gcc-3b7ea188c0457b2e70bdefc8cb53a790e7e9b296.tar.bz2
f95-lang.c (gfc_init_builtin_functions): Add more floating-point built-ins.
* f95-lang.c (gfc_init_builtin_functions): Add more floating-point built-ins. * mathbuiltins.def (OTHER_BUILTIN): Define built-ins for logb, remainder, rint and signbit. * trans-decl.c (save_fp_state, restore_fp_state): Move to trans-intrinsic.c (gfc_generate_function_code): Use new names for these two functions. * trans-expr.c (gfc_conv_function_expr): Catch IEEE functions to emit code from the front-end. * trans-intrinsic.c (gfc_save_fp_state, gfc_restore_fp_state, conv_ieee_function_args, conv_intrinsic_ieee_builtin, conv_intrinsic_ieee_is_normal, conv_intrinsic_ieee_is_negative, conv_intrinsic_ieee_logb_rint, conv_intrinsic_ieee_rem, conv_intrinsic_ieee_next_after, conv_intrinsic_ieee_scalb, conv_intrinsic_ieee_copy_sign, gfc_conv_ieee_arithmetic_function): New functions. * trans.h (gfc_conv_ieee_arithmetic_function, gfc_save_fp_state, gfc_restore_fp_state): New prototypes. * ieee/ieee_helper.c (ieee_is_finite_*, ieee_is_nan_*, ieee_is_negative_*, ieee_is_normal_*, ieee_copy_sign_*, ieee_unordered_*, ieee_logb_*, ieee_rint_*, ieee_scalb_*, ieee_rem_*, ieee_next_after_*): Remove functions. * gfortran.map (GFORTRAN_1.5): Remove corresponding symbols. From-SVN: r216036
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 7184504..92b350e 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -5619,36 +5619,6 @@ is_ieee_module_used (gfc_namespace *ns)
}
-static tree
-save_fp_state (stmtblock_t *block)
-{
- tree type, fpstate, tmp;
-
- type = build_array_type (char_type_node,
- build_range_type (size_type_node, size_zero_node,
- size_int (32)));
- fpstate = gfc_create_var (type, "fpstate");
- fpstate = gfc_build_addr_expr (pvoid_type_node, fpstate);
-
- tmp = build_call_expr_loc (input_location, gfor_fndecl_ieee_procedure_entry,
- 1, fpstate);
- gfc_add_expr_to_block (block, tmp);
-
- return fpstate;
-}
-
-
-static void
-restore_fp_state (stmtblock_t *block, tree fpstate)
-{
- tree tmp;
-
- tmp = build_call_expr_loc (input_location, gfor_fndecl_ieee_procedure_exit,
- 1, fpstate);
- gfc_add_expr_to_block (block, tmp);
-}
-
-
/* Generate code for a function. */
void
@@ -5760,7 +5730,7 @@ gfc_generate_function_code (gfc_namespace * ns)
the floating point state. */
ieee = is_ieee_module_used (ns);
if (ieee)
- fpstate = save_fp_state (&init);
+ fpstate = gfc_save_fp_state (&init);
/* Now generate the code for the body of this function. */
gfc_init_block (&body);
@@ -5847,7 +5817,7 @@ gfc_generate_function_code (gfc_namespace * ns)
/* If IEEE modules are loaded, restore the floating-point state. */
if (ieee)
- restore_fp_state (&cleanup, fpstate);
+ gfc_restore_fp_state (&cleanup, fpstate);
/* Finish the function body and add init and cleanup code. */
tmp = gfc_finish_block (&body);