+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
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);
/* 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 ();
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);