This is the mail archive of the gcc-bugs@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]

[Bug libfortran/26252] FAIL: gfortran.fortran-torture/execute/nan_inf_fmt.f90 execution



------- Comment #10 from fxcoudert at gcc dot gnu dot org  2008-03-01 12:08 -------
(In reply to comment #7)
> I tried the attached change.  It results in the correct configure
> results.  However, the test still fails.

By my reading, this patch will change nothing: it's OK for HAVE_BROKEN_ISFINITE
not be defined if isfinite is not defined, because we then have:

#if defined(HAVE_BROKEN_ISFINITE) || defined(__CYGWIN__)
#undef isfinite
#endif

#if !defined(isfinite)
// define isfinite
#endif

So, in your case, when isfinite and fpclassify are both functions (and not
macros), we're going to simply define isfinite as:
#define isfinite(x) ((x) - (x) == 0)

David, when you have time, can you test the two following replacements:

#define isnan(x)        __builtin_expect ((x) != (x), 0)
#define isfinite(x)     __builtin_expect (!isnan((x) - (x)), 1)
#define isinf(x)         __builtin_expect (!isnan(x) & !isfinite(x), 0)

and

#define isnan(x)        __builtin_isnan (x)
#define isfinite(x)     __builtin_isfinite (x)
#define isinf(x)        __builtin_isinf (x)

(they should go in libgfortran/libgfortran.h and replace the following block of
code: 

#if defined(HAVE_BROKEN_ISFINITE) || defined(__CYGWIN__)
...
#define isnan(x) (fpclassify(x) == FP_NAN)
#endif /* !defined(fpclassify) */
#endif /* !defined(isfinite)  */


Thanks,
FX


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26252


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