]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
builtins.c (builtin_dconsts_init, [...]): Delete.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Thu, 11 Sep 2003 21:40:41 +0000 (21:40 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Thu, 11 Sep 2003 21:40:41 +0000 (21:40 +0000)
* builtins.c (builtin_dconsts_init, dconstpi, dconste,
init_builtin_dconsts): Delete.
* emit-rtl.c (dconstpi, dconste): Define.
(init_emit_once): Initialize dconstpi & dconste.
* real.h (dconstpi, dconste): Declare.

From-SVN: r71320

gcc/ChangeLog
gcc/builtins.c
gcc/emit-rtl.c
gcc/real.h

index 0dfd488db67ed143082d1db3e2599124d8106761..d6d762417e8a86aa5242aa99bc018d279ac8015a 100644 (file)
@@ -1,3 +1,11 @@
+2003-09-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * builtins.c (builtin_dconsts_init, dconstpi, dconste,
+       init_builtin_dconsts): Delete.
+       * emit-rtl.c (dconstpi, dconste): Define.
+       (init_emit_once): Initialize dconstpi & dconste.
+       * real.h (dconstpi, dconste): Declare.
+
 2003-09-11  Alexandre Oliva  <aoliva@redhat.com>
 
        PR fortran/11522
index dfa047f06f504e709f3faac3e9949d702015680d..4df0e95b7f6afe3d612a50dd823bb63045d57e75 100644 (file)
@@ -79,11 +79,6 @@ tree built_in_decls[(int) END_BUILTINS];
    required to implement the function call in all cases.  */
 tree implicit_built_in_decls[(int) END_BUILTINS];
 
-/* Trigonometric and mathematical constants used in builtin folding.  */
-static bool builtin_dconsts_init = 0;
-static REAL_VALUE_TYPE dconstpi;
-static REAL_VALUE_TYPE dconste;
-
 static int get_pointer_alignment (tree, unsigned int);
 static tree c_strlen (tree, int);
 static const char *c_getstr (tree);
@@ -157,27 +152,12 @@ static tree fold_trunc_transparent_mathfn (tree);
 static bool readonly_data_expr (tree);
 static rtx expand_builtin_fabs (tree, rtx, rtx);
 static rtx expand_builtin_cabs (tree, rtx);
-static void init_builtin_dconsts (void);
 static tree fold_builtin_cabs (tree, tree, tree);
 static tree fold_builtin_trunc (tree);
 static tree fold_builtin_floor (tree);
 static tree fold_builtin_ceil (tree);
 static tree fold_builtin_bitop (tree);
 
-/* Initialize mathematical constants for constant folding builtins.
-   These constants need to be given to at least 160 bits precision.  */
-
-static void
-init_builtin_dconsts (void)
-{
-  real_from_string (&dconstpi,
-    "3.1415926535897932384626433832795028841971693993751058209749445923078");
-  real_from_string (&dconste,
-    "2.7182818284590452353602874713526624977572470936999595749669676277241");
-
-  builtin_dconsts_init = true;
-}
-
 /* Return the alignment in bits of EXP, a pointer valued expression.
    But don't return more than MAX_ALIGN no matter what.
    The alignment returned is, by default, the alignment of the thing that
@@ -6009,8 +5989,6 @@ fold_builtin_logarithm (tree exp, const REAL_VALUE_TYPE *value)
          case BUILT_IN_EXPF:
          case BUILT_IN_EXPL:
            /* Prepare to do logN(exp(exponent) -> exponent*logN(e).  */
-           if (! builtin_dconsts_init)
-             init_builtin_dconsts ();
            x = build_real (type,
                            real_value_truncate (TYPE_MODE (type), dconste));
            exponent = TREE_VALUE (TREE_OPERAND (arg, 1));
@@ -6283,8 +6261,6 @@ fold_builtin (tree exp)
     case BUILT_IN_EXP:
     case BUILT_IN_EXPF:
     case BUILT_IN_EXPL:
-      if (! builtin_dconsts_init)
-       init_builtin_dconsts ();
       return fold_builtin_exponent (exp, &dconste);
     case BUILT_IN_EXP2:
     case BUILT_IN_EXP2F:
@@ -6300,8 +6276,6 @@ fold_builtin (tree exp)
     case BUILT_IN_LOG:
     case BUILT_IN_LOGF:
     case BUILT_IN_LOGL:
-      if (! builtin_dconsts_init)
-       init_builtin_dconsts ();
       return fold_builtin_logarithm (exp, &dconste);
       break;
     case BUILT_IN_LOG2:
@@ -6353,8 +6327,6 @@ fold_builtin (tree exp)
            {
              REAL_VALUE_TYPE cst;
 
-             if (! builtin_dconsts_init)
-               init_builtin_dconsts ();
              real_convert (&cst, TYPE_MODE (type), &dconstpi);
              cst.exp -= 2;
              return build_real (type, cst);
index fbd72244b91ecd29027a73c37986638148c87be7..d5ff690cb3fed36bdf395ff27fe7267686d9c871 100644 (file)
@@ -116,6 +116,8 @@ REAL_VALUE_TYPE dconstm1;
 REAL_VALUE_TYPE dconstm2;
 REAL_VALUE_TYPE dconsthalf;
 REAL_VALUE_TYPE dconstthird;
+REAL_VALUE_TYPE dconstpi;
+REAL_VALUE_TYPE dconste;
 
 /* All references to the following fixed hard registers go through
    these unique rtl objects.  On machines where the frame-pointer and
@@ -5427,6 +5429,13 @@ init_emit_once (int line_numbers)
 
   real_arithmetic (&dconstthird, RDIV_EXPR, &dconst1, &dconst3);
 
+  /* Initialize mathematical constants for constant folding builtins.
+     These constants need to be given to at least 160 bits precision.  */
+  real_from_string (&dconstpi,
+    "3.1415926535897932384626433832795028841971693993751058209749445923078");
+  real_from_string (&dconste,
+    "2.7182818284590452353602874713526624977572470936999595749669676277241");
+
   for (i = 0; i < (int) ARRAY_SIZE (const_tiny_rtx); i++)
     {
       REAL_VALUE_TYPE *r =
index 0543b8f8f9d61239860e48d5743ff0259b2b92ac..4799204de560adefeda285c0f4186d33116bee24 100644 (file)
@@ -333,6 +333,8 @@ extern REAL_VALUE_TYPE dconstm1;
 extern REAL_VALUE_TYPE dconstm2;
 extern REAL_VALUE_TYPE dconsthalf;
 extern REAL_VALUE_TYPE dconstthird;
+extern REAL_VALUE_TYPE dconstpi;
+extern REAL_VALUE_TYPE dconste;
 
 /* Function to return a real value (not a tree node)
    from a given integer constant.  */