builtins.c (fold_fixed_mathfn, [...]): Take decomposed arguments of CALL_EXPR.
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 20 Mar 2005 14:39:01 +0000 (14:39 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 20 Mar 2005 14:39:01 +0000 (14:39 +0000)
* builtins.c (fold_fixed_mathfn, fold_builtin_trunc,
fold_builtin_floor, fold_builtin_ceil, fold_builtin_lround):
Take decomposed arguments of CALL_EXPR.
(fold_builtin_1): Update calls to the functions mentioned
above.

From-SVN: r96759

gcc/ChangeLog
gcc/builtins.c

index a3ab05c3552e30460e320b7b42b32e1fcb512af3..cc0a972c874d5f040d73a7582acf8f3d9c14cae0 100644 (file)
@@ -1,3 +1,11 @@
+2005-03-20  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * builtins.c (fold_fixed_mathfn, fold_builtin_trunc,
+       fold_builtin_floor, fold_builtin_ceil, fold_builtin_lround):
+       Take decomposed arguments of CALL_EXPR.
+       (fold_builtin_1): Update calls to the functions mentioned
+       above.
+
 2005-03-20  Joseph S. Myers  <joseph@codesourcery.com>
 
        * c-decl.c (check_bitfield_type_and_width): Require bit-field
index 7ed97fb7bf3b1f23e5ce0e697fd644dcd929ec0d..0f39ec36edbed0942fcf3bb517dd0b8ff4d9ddd9 100644 (file)
@@ -157,10 +157,10 @@ static tree fold_builtin_sin (tree);
 static tree fold_builtin_cos (tree, tree, tree);
 static tree fold_builtin_tan (tree);
 static tree fold_builtin_atan (tree, tree);
-static tree fold_builtin_trunc (tree);
-static tree fold_builtin_floor (tree);
-static tree fold_builtin_ceil (tree);
-static tree fold_builtin_round (tree);
+static tree fold_builtin_trunc (tree, tree);
+static tree fold_builtin_floor (tree, tree);
+static tree fold_builtin_ceil (tree, tree);
+static tree fold_builtin_round (tree, tree);
 static tree fold_builtin_bitop (tree, tree);
 static tree fold_builtin_memcpy (tree, tree);
 static tree fold_builtin_mempcpy (tree, tree, int);
@@ -6110,10 +6110,8 @@ fold_trunc_transparent_mathfn (tree fndecl, tree arglist)
    the argument, for instance lround((double)f) -> lroundf (f).  */
 
 static tree
-fold_fixed_mathfn (tree exp)
+fold_fixed_mathfn (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
   tree arg;
 
@@ -6501,10 +6499,8 @@ fold_builtin_atan (tree arglist, tree type)
    NULL_TREE if no simplification can be made.  */
 
 static tree
-fold_builtin_trunc (tree exp)
+fold_builtin_trunc (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   tree arg;
 
   if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
@@ -6529,10 +6525,8 @@ fold_builtin_trunc (tree exp)
    NULL_TREE if no simplification can be made.  */
 
 static tree
-fold_builtin_floor (tree exp)
+fold_builtin_floor (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   tree arg;
 
   if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
@@ -6562,10 +6556,8 @@ fold_builtin_floor (tree exp)
    NULL_TREE if no simplification can be made.  */
 
 static tree
-fold_builtin_ceil (tree exp)
+fold_builtin_ceil (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   tree arg;
 
   if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
@@ -6595,10 +6587,8 @@ fold_builtin_ceil (tree exp)
    NULL_TREE if no simplification can be made.  */
 
 static tree
-fold_builtin_round (tree exp)
+fold_builtin_round (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   tree arg;
 
   if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
@@ -6629,10 +6619,8 @@ fold_builtin_round (tree exp)
    simplification can be made.  */
 
 static tree
-fold_builtin_lround (tree exp)
+fold_builtin_lround (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   tree arg;
 
   if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
@@ -6659,7 +6647,7 @@ fold_builtin_lround (tree exp)
        }
     }
 
-  return fold_fixed_mathfn (exp);
+  return fold_fixed_mathfn (fndecl, arglist);
 }
 
 /* Fold function call to builtin ffs, clz, ctz, popcount and parity
@@ -8173,22 +8161,22 @@ fold_builtin_1 (tree exp, bool ignore)
     case BUILT_IN_FLOOR:
     case BUILT_IN_FLOORF:
     case BUILT_IN_FLOORL:
-      return fold_builtin_floor (exp);
+      return fold_builtin_floor (fndecl, arglist);
 
     case BUILT_IN_CEIL:
     case BUILT_IN_CEILF:
     case BUILT_IN_CEILL:
-      return fold_builtin_ceil (exp);
+      return fold_builtin_ceil (fndecl, arglist);
 
     case BUILT_IN_TRUNC:
     case BUILT_IN_TRUNCF:
     case BUILT_IN_TRUNCL:
-      return fold_builtin_trunc (exp);
+      return fold_builtin_trunc (fndecl, arglist);
 
     case BUILT_IN_ROUND:
     case BUILT_IN_ROUNDF:
     case BUILT_IN_ROUNDL:
-      return fold_builtin_round (exp);
+      return fold_builtin_round (fndecl, arglist);
 
     case BUILT_IN_NEARBYINT:
     case BUILT_IN_NEARBYINTF:
@@ -8204,7 +8192,7 @@ fold_builtin_1 (tree exp, bool ignore)
     case BUILT_IN_LLROUND:
     case BUILT_IN_LLROUNDF:
     case BUILT_IN_LLROUNDL:
-      return fold_builtin_lround (exp);
+      return fold_builtin_lround (fndecl, arglist);
 
     case BUILT_IN_LRINT:
     case BUILT_IN_LRINTF:
@@ -8212,7 +8200,7 @@ fold_builtin_1 (tree exp, bool ignore)
     case BUILT_IN_LLRINT:
     case BUILT_IN_LLRINTF:
     case BUILT_IN_LLRINTL:
-      return fold_fixed_mathfn (exp);
+      return fold_fixed_mathfn (fndecl, arglist);
 
     case BUILT_IN_FFS:
     case BUILT_IN_FFSL: