aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-11-17 18:42:48 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-11-17 18:42:48 +0000
commitd7ebef0648bc358514ed2048a46b22f801c19689 (patch)
treea16899561921af923a2765fbaea65fd54a54b63b /gcc/builtins.c
parent6bac43d760cdced2775cb17add346f757ee6f045 (diff)
downloadgcc-d7ebef0648bc358514ed2048a46b22f801c19689.zip
gcc-d7ebef0648bc358514ed2048a46b22f801c19689.tar.gz
gcc-d7ebef0648bc358514ed2048a46b22f801c19689.tar.bz2
Extend fold_const_call to combined_fn
This patch extends fold_const_call so that it can handle internal as well as built-in functions. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. gcc/ * fold-const-call.h (fold_const_call): Replace built_in_function arguments with combined_fn arguments. * fold-const-call.c: Include case-cfn-macros.h. (fold_const_call_ss, fold_const_call_cs, fold_const_call_sc) (fold_const_call_cc, fold_const_call_sss, fold_const_call_ccc) (fold_const_call_ssss, fold_const_call_1, fold_const_call): Replace built_in_function arguments with combined_fn arguments. * builtins.c (fold_builtin_sincos, fold_builtin_1, fold_builtin_2) (fold_builtin_3): Update calls to fold_const_call. From-SVN: r230477
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 303a5b0..fc038cd 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -7348,7 +7348,7 @@ fold_builtin_sincos (location_t loc,
if (TREE_CODE (arg0) == REAL_CST)
{
tree complex_type = build_complex_type (type);
- call = fold_const_call (fn, complex_type, arg0);
+ call = fold_const_call (as_combined_fn (fn), complex_type, arg0);
}
if (!call)
{
@@ -8193,7 +8193,7 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0)
if (TREE_CODE (arg0) == ERROR_MARK)
return NULL_TREE;
- if (tree ret = fold_const_call (fcode, type, arg0))
+ if (tree ret = fold_const_call (as_combined_fn (fcode), type, arg0))
return ret;
switch (fcode)
@@ -8320,7 +8320,7 @@ fold_builtin_2 (location_t loc, tree fndecl, tree arg0, tree arg1)
|| TREE_CODE (arg1) == ERROR_MARK)
return NULL_TREE;
- if (tree ret = fold_const_call (fcode, type, arg0, arg1))
+ if (tree ret = fold_const_call (as_combined_fn (fcode), type, arg0, arg1))
return ret;
switch (fcode)
@@ -8419,7 +8419,8 @@ fold_builtin_3 (location_t loc, tree fndecl,
|| TREE_CODE (arg2) == ERROR_MARK)
return NULL_TREE;
- if (tree ret = fold_const_call (fcode, type, arg0, arg1, arg2))
+ if (tree ret = fold_const_call (as_combined_fn (fcode), type,
+ arg0, arg1, arg2))
return ret;
switch (fcode)