summaryrefslogtreecommitdiff
path: root/gcc/convert.c
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-15 05:43:56 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-15 05:43:56 +0000
commit6f8a28875d01388c90ed96652e0f99c191f8547c (patch)
tree6cece628e71c04ff9e27b7ef90ee01ffb2ef5922 /gcc/convert.c
parentc3bec18a4a3fc6046418c25969cc6c5f290788c6 (diff)
downloadgcc-6f8a28875d01388c90ed96652e0f99c191f8547c.tar.gz
PR tree-optimization/21004
* convert.c (convert_to_integer): Convert ceilf, ceill, floorf and floorl in c99 mode only. * builtins.c (expand_builtin_int_roundingfn): Assert that fallback_fndecl is not NULL_TREE. testsuite: PR tree-optimization/21004 * gcc.dg/builtins-53.c: Include builtins-config.h. Check floorf, ceilf, floorl and ceill transformations only when HAVE_C99_RUNTIME is defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/convert.c')
-rw-r--r--gcc/convert.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/convert.c b/gcc/convert.c
index 4e0fc84050b..c6c2620ab11 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -349,14 +349,26 @@ convert_to_integer (tree type, tree expr)
switch (fcode)
{
- case BUILT_IN_CEIL: case BUILT_IN_CEILF: case BUILT_IN_CEILL:
+ case BUILT_IN_CEILF:
+ case BUILT_IN_CEILL:
+ /* Only convert in ISO C99 mode. */
+ if (!TARGET_C99_FUNCTIONS)
+ break;
+ /* ... Fall through ... */
+ case BUILT_IN_CEIL:
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node))
fn = mathfn_built_in (s_intype, BUILT_IN_LLCEIL);
else
fn = mathfn_built_in (s_intype, BUILT_IN_LCEIL);
break;
- case BUILT_IN_FLOOR: case BUILT_IN_FLOORF: case BUILT_IN_FLOORL:
+ case BUILT_IN_FLOORF:
+ case BUILT_IN_FLOORL:
+ /* Only convert in ISO C99 mode. */
+ if (!TARGET_C99_FUNCTIONS)
+ break;
+ /* ... Fall through ... */
+ case BUILT_IN_FLOOR:
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node))
fn = mathfn_built_in (s_intype, BUILT_IN_LLFLOOR);
else