OSDN Git Service

* f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Mar 2009 17:37:02 +0000 (17:37 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Mar 2009 17:37:02 +0000 (17:37 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145307 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/f95-lang.c
gcc/fortran/trans-intrinsic.c

index bcb3a60..51f82c5 100644 (file)
@@ -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
index a7d6c8f..b8f2d22 100644 (file)
@@ -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);
index c2525bf..a8ac42e 100644 (file)
@@ -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);