This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with accessing built-ins from Fortran front-end
- From: Jakub Jelinek <jakub at redhat dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Fortran List <fortran at gcc dot gnu dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 26 Sep 2014 11:11:26 +0200
- Subject: Re: Problem with accessing built-ins from Fortran front-end
- Authentication-results: sourceware.org; auth=none
- References: <91DCE093-1239-4C0D-9F41-D3BDE9887F53 at gmail dot com> <20140926085644 dot GQ17454 at tucnak dot redhat dot com> <1594AB3B-1D7D-416D-9C47-F9F7FE928498 at gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 26, 2014 at 11:07:28AM +0200, FX wrote:
> > Thus, the middle-end assumes that if you have __builtin_{isfinite,isnormal},
> > you also have __builtin_is{less,greater}equal builtins too.
>
> Many thanks to both of you! I wasnât looking into the right place at all. I defined them, and now it works.
>
> One related question: the __builtin_signbit is not type generic, is there
> any reason for it not to be? Is there any reason for it not to be? I ask
I guess history, builtins that were added earlier when we didn't have any
typegeneric builtins were all *{f,,l} etc. suffixed.
As they are used quite heavily in user code, it is too late to change that.
Just look at what glibc <math.h> does for years:
/* Return nonzero value if sign of X is negative. */
# ifdef __NO_LONG_DOUBLE_MATH
# define signbit(x) \
(sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
# else
# define signbit(x) \
(sizeof (x) == sizeof (float) \
? __signbitf (x) \
: sizeof (x) == sizeof (double) \
? __signbit (x) : __signbitl (x))
# endif
We can't stop supporting that.
Jakub