diff options
author | Roger Sayle <roger@eyesopen.com> | 2007-02-05 19:10:44 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2007-02-05 19:10:44 +0000 |
commit | 2d38026be8d69796e18179b869b50f52ac7cd032 (patch) | |
tree | 3c97b40f1a12e9f5fd3092e3cdda0637b1dfbb41 /gcc/fold-const.c | |
parent | 7056b82ec7193b85771c1f4aab60daa6b3617250 (diff) | |
download | gcc-2d38026be8d69796e18179b869b50f52ac7cd032.zip gcc-2d38026be8d69796e18179b869b50f52ac7cd032.tar.gz gcc-2d38026be8d69796e18179b869b50f52ac7cd032.tar.bz2 |
fold-const.c (fold_unary): Test for availability of BUILT_IN_COS before simplifying REAL_PART(CEXPI)) to COS.
* fold-const.c (fold_unary) <REAL_PART>: Test for availability of
BUILT_IN_COS before simplifying REAL_PART(CEXPI)) to COS.
<IMAG_PART>: Likewise, check for availability of BUILT_IN_SIN.
* builtins.c (fold_builtin_sincos): Check for TARGET_C99_FUNCTIONS
before canonicalizing sincos to cexpi.
(fold_builtin_cexp): Likewise, for canonicalizing cexp to cexpi.
From-SVN: r121607
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ee2c469..c147efa 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7769,9 +7769,13 @@ fold_unary (enum tree_code code, tree type, tree op0) { CASE_FLT_FN (BUILT_IN_CEXPI): fn = mathfn_built_in (type, BUILT_IN_COS); - return build_function_call_expr (fn, TREE_OPERAND (arg0, 1)); + if (fn) + return build_function_call_expr (fn, + TREE_OPERAND (arg0, 1)); + break; - default:; + default: + break; } } return NULL_TREE; @@ -7808,9 +7812,13 @@ fold_unary (enum tree_code code, tree type, tree op0) { CASE_FLT_FN (BUILT_IN_CEXPI): fn = mathfn_built_in (type, BUILT_IN_SIN); - return build_function_call_expr (fn, TREE_OPERAND (arg0, 1)); + if (fn) + return build_function_call_expr (fn, + TREE_OPERAND (arg0, 1)); + break; - default:; + default: + break; } } return NULL_TREE; |