diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 12 | ||||
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 12 |
3 files changed, 19 insertions, 12 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bcb3a60..51f82c5 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2009-03-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + * f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL + family of intrinsics instead of BUILT_IN_INF family. + * trans-intrinsics.c (gfc_conv_intrinsic_nearest): Use + BUILT_IN_HUGE_VAL instead of BUILT_IN_INF. + 2009-03-30 Jakub Jelinek <jakub@redhat.com> * trans-types.c (gfc_sym_type, gfc_return_by_reference): For diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index a7d6c8f..b8f2d22 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -917,12 +917,12 @@ gfc_init_builtin_functions (void) gfc_define_builtin ("__builtin_fmodf", mfunc_float[1], BUILT_IN_FMODF, "fmodf", true); - gfc_define_builtin ("__builtin_infl", mfunc_longdouble[3], - BUILT_IN_INFL, "__builtin_infl", true); - gfc_define_builtin ("__builtin_inf", mfunc_double[3], - BUILT_IN_INF, "__builtin_inf", true); - gfc_define_builtin ("__builtin_inff", mfunc_float[3], - BUILT_IN_INFF, "__builtin_inff", true); + gfc_define_builtin ("__builtin_huge_vall", mfunc_longdouble[3], + BUILT_IN_HUGE_VALL, "__builtin_huge_vall", true); + gfc_define_builtin ("__builtin_huge_val", mfunc_double[3], + BUILT_IN_HUGE_VAL, "__builtin_huge_val", true); + gfc_define_builtin ("__builtin_huge_valf", mfunc_float[3], + BUILT_IN_HUGE_VALF, "__builtin_huge_valf", true); /* lround{f,,l} and llround{f,,l} */ type = tree_cons (NULL_TREE, float_type_node, void_list_node); diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index c2525bfa..a8ac42e 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -3130,32 +3130,32 @@ gfc_conv_intrinsic_fraction (gfc_se * se, gfc_expr * expr) /* NEAREST (s, dir) is translated into - tmp = copysign (INF, dir); + tmp = copysign (HUGE_VAL, dir); return nextafter (s, tmp); */ static void gfc_conv_intrinsic_nearest (gfc_se * se, gfc_expr * expr) { tree args[2], type, tmp; - int nextafter, copysign, inf; + int nextafter, copysign, huge_val; switch (expr->ts.kind) { case 4: nextafter = BUILT_IN_NEXTAFTERF; copysign = BUILT_IN_COPYSIGNF; - inf = BUILT_IN_INFF; + huge_val = BUILT_IN_HUGE_VALF; break; case 8: nextafter = BUILT_IN_NEXTAFTER; copysign = BUILT_IN_COPYSIGN; - inf = BUILT_IN_INF; + huge_val = BUILT_IN_HUGE_VAL; break; case 10: case 16: nextafter = BUILT_IN_NEXTAFTERL; copysign = BUILT_IN_COPYSIGNL; - inf = BUILT_IN_INFL; + huge_val = BUILT_IN_HUGE_VALL; break; default: gcc_unreachable (); @@ -3164,7 +3164,7 @@ gfc_conv_intrinsic_nearest (gfc_se * se, gfc_expr * expr) type = gfc_typenode_for_spec (&expr->ts); gfc_conv_intrinsic_function_args (se, expr, args, 2); tmp = build_call_expr (built_in_decls[copysign], 2, - build_call_expr (built_in_decls[inf], 0), + build_call_expr (built_in_decls[huge_val], 0), fold_convert (type, args[1])); se->expr = build_call_expr (built_in_decls[nextafter], 2, fold_convert (type, args[0]), tmp); |