[PATCH, middle-end, commited]: Fix PR21282

Roger Sayle roger@eyesopen.com
Tue May 3 15:13:00 GMT 2005


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
--



More information about the Gcc-patches mailing list