builtins.c (fold_trunc_transparent_mathfn): Take decomposed arguments of CALL_EXPR.
authorKazu Hirata <kazu@cs.umass.edu>
Sat, 19 Mar 2005 18:01:19 +0000 (18:01 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sat, 19 Mar 2005 18:01:19 +0000 (18:01 +0000)
* builtins.c (fold_trunc_transparent_mathfn): Take decomposed
arguments of CALL_EXPR.
(fold_builtin_trunc, fold_builtin_floor, fold_builtin_ceil,
fold_builtin_found, fold_builtin_1): Update calls to
fold_trunc_transparent_mathfn.

From-SVN: r96736

gcc/ChangeLog
gcc/builtins.c

index 5f2f1096f6797df48c2107314f3a27827578c2f9..7b537beead25d79695978178cc348f546f6f08ed 100644 (file)
@@ -5,6 +5,12 @@
        (expand_builtin_memcpy, fold_builtin_1): Update calls to
        fold_builtin_memcpy.
 
+       * builtins.c (fold_trunc_transparent_mathfn): Take decomposed
+       arguments of CALL_EXPR.
+       (fold_builtin_trunc, fold_builtin_floor, fold_builtin_ceil,
+       fold_builtin_found, fold_builtin_1): Update calls to
+       fold_trunc_transparent_mathfn.
+
 2005-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR middle-end/20493
index 98a84f1ef3af9cdfc8369bc16b9b263063b75a3f..7ed97fb7bf3b1f23e5ce0e697fd644dcd929ec0d 100644 (file)
@@ -144,7 +144,7 @@ static tree fold_builtin_inf (tree, int);
 static tree fold_builtin_nan (tree, tree, int);
 static int validate_arglist (tree, ...);
 static bool integer_valued_real_p (tree);
-static tree fold_trunc_transparent_mathfn (tree);
+static tree fold_trunc_transparent_mathfn (tree, tree);
 static bool readonly_data_expr (tree);
 static rtx expand_builtin_fabs (tree, rtx, rtx);
 static rtx expand_builtin_signbit (tree, rtx);
@@ -6069,10 +6069,8 @@ integer_valued_real_p (tree t)
    Do the transformation.  */
 
 static tree
-fold_trunc_transparent_mathfn (tree exp)
+fold_trunc_transparent_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;
 
@@ -6524,7 +6522,7 @@ fold_builtin_trunc (tree exp)
       return build_real (type, r);
     }
 
-  return fold_trunc_transparent_mathfn (exp);
+  return fold_trunc_transparent_mathfn (fndecl, arglist);
 }
 
 /* Fold function call to builtin floor, floorf or floorl.  Return
@@ -6557,7 +6555,7 @@ fold_builtin_floor (tree exp)
        }
     }
 
-  return fold_trunc_transparent_mathfn (exp);
+  return fold_trunc_transparent_mathfn (fndecl, arglist);
 }
 
 /* Fold function call to builtin ceil, ceilf or ceill.  Return
@@ -6590,7 +6588,7 @@ fold_builtin_ceil (tree exp)
        }
     }
 
-  return fold_trunc_transparent_mathfn (exp);
+  return fold_trunc_transparent_mathfn (fndecl, arglist);
 }
 
 /* Fold function call to builtin round, roundf or roundl.  Return
@@ -6623,7 +6621,7 @@ fold_builtin_round (tree exp)
        }
     }
 
-  return fold_trunc_transparent_mathfn (exp);
+  return fold_trunc_transparent_mathfn (fndecl, arglist);
 }
 
 /* Fold function call to builtin lround, lroundf or lroundl (or the
@@ -8198,7 +8196,7 @@ fold_builtin_1 (tree exp, bool ignore)
     case BUILT_IN_RINT:
     case BUILT_IN_RINTF:
     case BUILT_IN_RINTL:
-      return fold_trunc_transparent_mathfn (exp);
+      return fold_trunc_transparent_mathfn (fndecl, arglist);
 
     case BUILT_IN_LROUND:
     case BUILT_IN_LROUNDF: