This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] middle-end: convert builtin finite -> MINUS/ORD


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]