diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-09 09:35:22 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-09 09:35:22 +0000 |
commit | fd49466951f7a9b62ec981be537381f35491904c (patch) | |
tree | aa6c40c6717271081bdecfd2d7b64a4176ecbf76 /gcc/convert.c | |
parent | 8aebec334052cfe3b570a09bd1d7b269e99f6bb9 (diff) | |
download | gcc-fd49466951f7a9b62ec981be537381f35491904c.tar.gz |
2009-02-09 Richard Guenther <rguenther@suse.de>
PR middle-end/35202
* convert.c (convert_to_real): Disable (float)fn((double)x)
to fnf(x) conversion if errno differences may occur and
-fmath-errno is set.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144030 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/convert.c')
-rw-r--r-- | gcc/convert.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/gcc/convert.c b/gcc/convert.c index 77907bafcb5..278305d8fdb 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -139,40 +139,45 @@ convert_to_real (tree type, tree expr) switch (fcode) { #define CASE_MATHFN(FN) case BUILT_IN_##FN: case BUILT_IN_##FN##L: - CASE_MATHFN (ACOS) - CASE_MATHFN (ACOSH) - CASE_MATHFN (ASIN) - CASE_MATHFN (ASINH) - CASE_MATHFN (ATAN) - CASE_MATHFN (ATANH) - CASE_MATHFN (CBRT) - CASE_MATHFN (COS) CASE_MATHFN (COSH) - CASE_MATHFN (ERF) - CASE_MATHFN (ERFC) CASE_MATHFN (EXP) CASE_MATHFN (EXP10) CASE_MATHFN (EXP2) - CASE_MATHFN (EXPM1) - CASE_MATHFN (FABS) + CASE_MATHFN (EXPM1) CASE_MATHFN (GAMMA) CASE_MATHFN (J0) CASE_MATHFN (J1) CASE_MATHFN (LGAMMA) - CASE_MATHFN (LOG) - CASE_MATHFN (LOG10) - CASE_MATHFN (LOG1P) - CASE_MATHFN (LOG2) - CASE_MATHFN (LOGB) CASE_MATHFN (POW10) - CASE_MATHFN (SIN) CASE_MATHFN (SINH) - CASE_MATHFN (SQRT) - CASE_MATHFN (TAN) - CASE_MATHFN (TANH) CASE_MATHFN (TGAMMA) CASE_MATHFN (Y0) CASE_MATHFN (Y1) + /* The above functions may set errno differently with float + input or output so this transformation is not safe with + -fmath-errno. */ + if (flag_errno_math) + break; + CASE_MATHFN (ACOS) + CASE_MATHFN (ACOSH) + CASE_MATHFN (ASIN) + CASE_MATHFN (ASINH) + CASE_MATHFN (ATAN) + CASE_MATHFN (ATANH) + CASE_MATHFN (CBRT) + CASE_MATHFN (COS) + CASE_MATHFN (ERF) + CASE_MATHFN (ERFC) + CASE_MATHFN (FABS) + CASE_MATHFN (LOG) + CASE_MATHFN (LOG10) + CASE_MATHFN (LOG2) + CASE_MATHFN (LOG1P) + CASE_MATHFN (LOGB) + CASE_MATHFN (SIN) + CASE_MATHFN (SQRT) + CASE_MATHFN (TAN) + CASE_MATHFN (TANH) #undef CASE_MATHFN { tree arg0 = strip_float_extensions (CALL_EXPR_ARG (expr, 0)); |