diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-19 03:39:30 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-19 03:39:30 +0000 |
commit | 81859e4d1552229be7ea17d22d67550c37c3c8e3 (patch) | |
tree | 741e6c5858ede0c113657002a0e38326d9827c12 /gcc/convert.c | |
parent | cf4bfce5608558cdffa703b1b13e65f9c8b6bfda (diff) | |
download | gcc-81859e4d1552229be7ea17d22d67550c37c3c8e3.tar.gz |
* 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}.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63087 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/convert.c')
-rw-r--r-- | gcc/convert.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/convert.c b/gcc/convert.c index 73db933b97e..4ac23a7f44c 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -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))) { |