builtins.c (fold_builtin_unordered_cmp): Change prototype to take a fndecl and an...
authorRoger Sayle <roger@eyesopen.com>
Wed, 9 Mar 2005 17:30:11 +0000 (17:30 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Wed, 9 Mar 2005 17:30:11 +0000 (17:30 +0000)
* builtins.c (fold_builtin_unordered_cmp): Change prototype to take
a fndecl and an arglist instead of a CALL_EXPR, exp.

From-SVN: r96196

gcc/ChangeLog
gcc/builtins.c

index 9cd776693d43a529464b9c52598b5fd3b7676b6e..99567ed01c2632b12f4ac43d490fd72a0ee5a334 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-09  Roger Sayle  <roger@eyesopen.com>
+
+       * builtins.c (fold_builtin_unordered_cmp): Change prototype to take
+       a fndecl and an arglist instead of a CALL_EXPR, exp.
+
 2005-03-09  Kazu Hirata  <kazu@cs.umass.edu>
 
        * cfglayout.c (fixup_reorder_chain): Remove old_bb.
index 078edc39b5177fba7e0b6fb686d20ab16143c525..5d9aa77f4e7121e8a54d5fe9f8f4a251dbc6834e 100644 (file)
@@ -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: