aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index c33cdf1..d122379 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -9344,6 +9344,18 @@ fold_builtin_1 (tree fndecl, tree arglist, bool ignore)
TREE_VALUE (arglist)));
break;
+ CASE_FLT_FN (BUILT_IN_CCOS):
+ CASE_FLT_FN (BUILT_IN_CCOSH):
+ /* These functions are "even", i.e. f(x) == f(-x). */
+ if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE))
+ {
+ tree narg = fold_strip_sign_ops (TREE_VALUE (arglist));
+ if (narg)
+ return build_function_call_expr (fndecl,
+ build_tree_list (NULL_TREE, narg));
+ }
+ break;
+
CASE_FLT_FN (BUILT_IN_CABS):
return fold_builtin_cabs (arglist, type, fndecl);