aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-03-09 17:30:11 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-03-09 17:30:11 +0000
commita35da91ff29d52b54f6238c6437dafd799abfd51 (patch)
tree667d6df60b505f9768fb79b4516f9e6ad57e1c9a /gcc/builtins.c
parenta2fee3d5285d0b2bbb7f49079187fe9e69cd1b05 (diff)
downloadgcc-a35da91ff29d52b54f6238c6437dafd799abfd51.zip
gcc-a35da91ff29d52b54f6238c6437dafd799abfd51.tar.gz
gcc-a35da91ff29d52b54f6238c6437dafd799abfd51.tar.bz2
builtins.c (fold_builtin_unordered_cmp): Change prototype to take a fndecl and an arglist instead of a CALL_EXPR, exp.
* builtins.c (fold_builtin_unordered_cmp): Change prototype to take a fndecl and an arglist instead of a CALL_EXPR, exp. From-SVN: r96196
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 078edc3..5d9aa77 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -176,7 +176,8 @@ static tree fold_builtin_toascii (tree);
static tree fold_builtin_isdigit (tree);
static tree fold_builtin_fabs (tree, tree);
static tree fold_builtin_abs (tree, tree);
-static tree fold_builtin_unordered_cmp (tree, enum tree_code, enum tree_code);
+static tree fold_builtin_unordered_cmp (tree, tree, enum tree_code,
+ enum tree_code);
static tree fold_builtin_1 (tree, bool);
static tree fold_builtin_strpbrk (tree, tree);
@@ -7766,19 +7767,18 @@ fold_builtin_classify (tree exp, int builtin_index)
}
/* Fold a call to an unordered comparison function such as
- __builtin_isgreater(). EXP is the CALL_EXPR for the call.
+ __builtin_isgreater(). FNDECL is the FUNCTION_DECL for the function
+ being called and ARGLIST is the argument list for the call.
UNORDERED_CODE and ORDERED_CODE are comparison codes that give
the opposite of the desired result. UNORDERED_CODE is used
for modes that can hold NaNs and ORDERED_CODE is used for
the rest. */
static tree
-fold_builtin_unordered_cmp (tree exp,
+fold_builtin_unordered_cmp (tree fndecl, tree arglist,
enum tree_code unordered_code,
enum tree_code ordered_code)
{
- tree fndecl = get_callee_fndecl (exp);
- tree arglist = TREE_OPERAND (exp, 1);
tree type = TREE_TYPE (TREE_TYPE (fndecl));
enum tree_code code;
tree arg0, arg1;
@@ -8211,17 +8211,18 @@ fold_builtin_1 (tree exp, bool ignore)
return fold_builtin_classify (exp, BUILT_IN_ISNAN);
case BUILT_IN_ISGREATER:
- return fold_builtin_unordered_cmp (exp, UNLE_EXPR, LE_EXPR);
+ return fold_builtin_unordered_cmp (fndecl, arglist, UNLE_EXPR, LE_EXPR);
case BUILT_IN_ISGREATEREQUAL:
- return fold_builtin_unordered_cmp (exp, UNLT_EXPR, LT_EXPR);
+ return fold_builtin_unordered_cmp (fndecl, arglist, UNLT_EXPR, LT_EXPR);
case BUILT_IN_ISLESS:
- return fold_builtin_unordered_cmp (exp, UNGE_EXPR, GE_EXPR);
+ return fold_builtin_unordered_cmp (fndecl, arglist, UNGE_EXPR, GE_EXPR);
case BUILT_IN_ISLESSEQUAL:
- return fold_builtin_unordered_cmp (exp, UNGT_EXPR, GT_EXPR);
+ return fold_builtin_unordered_cmp (fndecl, arglist, UNGT_EXPR, GT_EXPR);
case BUILT_IN_ISLESSGREATER:
- return fold_builtin_unordered_cmp (exp, UNEQ_EXPR, EQ_EXPR);
+ return fold_builtin_unordered_cmp (fndecl, arglist, UNEQ_EXPR, EQ_EXPR);
case BUILT_IN_ISUNORDERED:
- return fold_builtin_unordered_cmp (exp, UNORDERED_EXPR, NOP_EXPR);
+ return fold_builtin_unordered_cmp (fndecl, arglist, UNORDERED_EXPR,
+ NOP_EXPR);
/* We do the folding for va_start in the expander. */
case BUILT_IN_VA_START: