diff options
author | Roger Sayle <roger@eyesopen.com> | 2006-10-30 01:14:37 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2006-10-30 01:14:37 +0000 |
commit | 7c73bdc185341485061329f6eab27fd82450c593 (patch) | |
tree | 65cf360f244bf158111d44da4a2e2a43cb0c67b2 | |
parent | bd91e5ba22dd6b98c4aedb7ae9a5580bb97be510 (diff) | |
download | gcc-7c73bdc185341485061329f6eab27fd82450c593.zip gcc-7c73bdc185341485061329f6eab27fd82450c593.tar.gz gcc-7c73bdc185341485061329f6eab27fd82450c593.tar.bz2 |
builtins.c (fold_builtin_floor): Check for the availability of the C99 trunc function before transforming floor...
* builtins.c (fold_builtin_floor): Check for the availability of
the C99 trunc function before transforming floor into trunc.
From-SVN: r118168
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/builtins.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c4f0bcd..0d31903 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-10-29 Roger Sayle <roger@eyesopen.com> + + * builtins.c (fold_builtin_floor): Check for the availability of + the C99 trunc function before transforming floor into trunc. + 2006-10-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * builtins.c (fold_builtin_hypot): Rearrange recursive diff --git a/gcc/builtins.c b/gcc/builtins.c index 3af86cc..b3e82d5 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -7311,9 +7311,11 @@ fold_builtin_floor (tree fndecl, tree arglist) /* Fold floor (x) where x is nonnegative to trunc (x). */ if (tree_expr_nonnegative_p (arg)) - return build_function_call_expr (mathfn_built_in (TREE_TYPE (arg), - BUILT_IN_TRUNC), - arglist); + { + tree truncfn = mathfn_built_in (TREE_TYPE (arg), BUILT_IN_TRUNC); + if (truncfn) + return build_function_call_expr (truncfn, arglist); + } return fold_trunc_transparent_mathfn (fndecl, arglist); } |