+2005-04-15 Uros Bizjak <uros@kss-loka.si>
+
+ 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.
+
2005-04-15 Kazu Hirata <kazu@cs.umass.edu>
* cfgrtl.c (purge_all_dead_edge): Remove an unused argument.
/* Fall back to floating point rounding optab. */
fallback_fndecl = mathfn_built_in (TREE_TYPE (arg), fallback_fn);
+ /* We shouldn't get here on targets without TARGET_C99_FUNCTIONS.
+ ??? Perhaps convert (int)floorf(x) into (int)floor((double)x). */
+ gcc_assert (fallback_fndecl != NULL_TREE);
exp = build_function_call_expr (fallback_fndecl, arglist);
tmp = expand_builtin_mathfn (exp, NULL_RTX, NULL_RTX);
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
+2005-04-15 Uros Bizjak <uros@kss-loka.si>
+
+ 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.
+
2005-04-15 Alexandre Oliva <aoliva@redhat.com>
PR middle-end/20739
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math" } */
+#include "builtins-config.h"
+
extern double floor(double);
extern double ceil(double);
extern double trunc(double);
return trunc(x);
}
+#ifdef HAVE_C99_RUNTIME
long int test1f(float x)
{
return floorf(x);
{
return ceilf(x);
}
+#endif
long int test5f(float x)
{
return truncf(x);
}
+#ifdef HAVE_C99_RUNTIME
long int test1l(long double x)
{
return floorl(x);
{
return ceill(x);
}
+#endif
long int test5l(long double x)
{