This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, midlevel]: Fix PR tree-optimization/21004
- From: Roger Sayle <roger at eyesopen dot com>
- To: Uros Bizjak <uros at kss-loka dot si>
- Cc: jsm28 at gcc dot gnu dot org, <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Apr 2005 09:41:48 -0600 (MDT)
- Subject: Re: [PATCH, midlevel]: Fix PR tree-optimization/21004
On Thu, 14 Apr 2005, Uros Bizjak wrote:
> 2005-04-14 Uros Bizjak <uros@kss-loka.si>
>
> * convert.c (convert_to_integer): Convert ceilf, ceill, floorf
> and floorl in c99 mode only.
This on it's own isn't sufficient to fix the failure of builtins-53.c
on non-C99 platforms, and although it prevents the segmentation fault,
we should really explicitly catch this failure in future.
In addition to your above patch, could you modify builtins-53.c to
#include "builtins-config.c" and then only test the float and long
double variants if HAVE_C99_RUNTIME is defined. This follows the
example of builtins-20.c, i.e. dejagnu tests shouldn't call the
float/long double versions of the math functions on all platforms.
Then secondly, in builtins.c's expand_builtin_int_roundingfn, could
you add an assert after calling mathfn_built_in, i.e.
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);
I'll preapprove your patch together with the above two refinements
if it passes bootstrap and regression testing without problems.
Thanks in advance, and sorry for not spotting this during review.
Roger
--