[PATCH] middle-end: convert builtin finite -> MINUS/ORD
Jakub Jelinek
jakub@redhat.com
Tue Jun 12 10:21:00 GMT 2007
On Tue, Jun 12, 2007 at 02:20:54AM -0400, Kaveh R. GHAZI wrote:
> On Mon, 11 Jun 2007, Andrew Pinski wrote:
>
> > On 6/11/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > > This patch adds a transformation of builtin finite(x) into:
> > >
> > > tmp = x - x;
> > > result = tmp ORD tmp;
> >
> > This can only be done when trapping math is turned off, otherwise
> > NAN-NAN could invoke a trap.
> > --Pinski
>
> At first I thought you meant signalling NaNs, but then I tried adding
> __builtin_nans*("") to the testcase and it worked. So I'm not sure under
> what conditions a trap arises. Maybe it's platforms specific. Could you
> please elaborate?
AFAIK isfinite/isinf/isnan/isnormal/fpclassify/signbit aren't supposed to
raise exceptions even for signalling NaNs.
Jakub
More information about the Gcc-patches
mailing list