This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, middle-end, commited]: Fix PR21282
- From: Roger Sayle <roger at eyesopen dot com>
- To: Uros Bizjak <uros at kss-loka dot si>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 May 2005 09:13:37 -0600 (MDT)
- Subject: Re: [PATCH, middle-end, commited]: Fix PR21282
On Tue, 3 May 2005, Uros Bizjak wrote:
> 2005-05-03 Uros Bizjak <uros@kss-loka.si>
>
> PR middle-end/21282
> * convert.c (convert_to_integer): Convert ceil and floor in
> c99 mode only.
Hi Uros,
Whilst your patch is fine as written, it would be slightly better to
implement these checks as implicit_built_in_decls[fcode] != NULL_TREE
instead of just !TARGET_C99_FUNCTIONS.
TARGET_C99_FUNCTIONS is a very course grained macro to described the
available runtime library. At some point in the future it may make
sense to refine this, and/or allow backends to specify that they have
the float versions of the math functions but not the long double versions,
or that they have sqrtf but not acosf, for example. [Maybe even by
probing the target library with configure?]
The real test that we want here is not whether the target provides
the entirety of the C99 runtime, but specifically whether "floorf",
"floorl", "ceilf" or "ceill" is available, which is better done by
testing implicit_built_in_decls with the appropriate function code.
Admittedly, there is currently no or little difference between the
two approaches. Just a suggestion for a small follow-up patch.
Roger
--