convert.c (convert_to_real): Also optimize (float)log(x) into logf(x) where x is...
authorRoger Sayle <roger@eyesopen.com>
Wed, 19 Feb 2003 03:39:30 +0000 (03:39 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Wed, 19 Feb 2003 03:39:30 +0000 (03:39 +0000)
* convert.c (convert_to_real): Also optimize (float)log(x) into
logf(x) where x is a float, i.e. also handle BUILT_IN_LOG{,L}.

From-SVN: r63087

gcc/ChangeLog
gcc/convert.c

index 07ba9970bc52914be602d995b6ba9a6ebf0bf58e..8e5b2976a06f79aef46f8dc21725bd441266dec8 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-18  Roger Sayle  <roger@eyesopen.com>
+
+       * convert.c (convert_to_real): Also optimize (float)log(x) into
+       logf(x) where x is a float, i.e. also handle BUILT_IN_LOG{,L}.
+
 2003-02-18  Kaz Kojima  <kkojima@gcc.gnu.org>
 
         * config/sh/sh.c (unspec_caller_rtx_p): New.
index 73db933b97e27b201f23e5b4cba60480a6c2a83a..4ac23a7f44ce8c9f66f99e3f7309987514fefe24 100644 (file)
@@ -1,6 +1,6 @@
 /* Utility routines for data type conversion for GNU C.
-   Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1997,
-   1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1997, 1998,
+   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -133,15 +133,17 @@ convert_to_real (type, expr)
   /* Disable until we figure out how to decide whether the functions are
      present in runtime.  */
   /* Convert (float)sqrt((double)x) where x is float into sqrtf(x) */
-  if ((fcode == BUILT_IN_SQRT
-       || fcode == BUILT_IN_SQRTL
-       || fcode == BUILT_IN_SIN
-       || fcode == BUILT_IN_SINL
-       || fcode == BUILT_IN_COS
-       || fcode == BUILT_IN_COSL
-       || fcode == BUILT_IN_EXP
-       || fcode == BUILT_IN_EXPL)
-      && optimize
+  if (optimize
+      && (fcode == BUILT_IN_SQRT
+         || fcode == BUILT_IN_SQRTL
+         || fcode == BUILT_IN_SIN
+         || fcode == BUILT_IN_SINL
+         || fcode == BUILT_IN_COS
+         || fcode == BUILT_IN_COSL
+         || fcode == BUILT_IN_EXP
+         || fcode == BUILT_IN_EXPL
+         || fcode == BUILT_IN_LOG
+         || fcode == BUILT_IN_LOGL)
       && (TYPE_MODE (type) == TYPE_MODE (double_type_node)
           || TYPE_MODE (type) == TYPE_MODE (float_type_node)))
     {