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/29302] nan_inf_fmt.f90 segfaults on Darwin PPC starting with Xcode 2.4



------- Comment #15 from howarth at nitro dot med dot uc dot edu  2006-11-01 04:33 -------
   I have pinned down the problem. On Darwin PPC with Xcode 2.4, at -O1 or
higher we have problems with the isfinite() macro from libgfortran.h. For the
nan_inf_fmt testcase it should always return 0, but
it doesn't at -O1 or higher. I think we are seeing the same glitch that was
fixed in python for gcc 4.2.
The current macro looks like...

#if !defined(isfinite)
#if !defined(fpclassify)
#define isfinite(x) ((x) - (x) == 0)
#else
#define isfinite(x) (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
#endif /* !defined(fpclassify) */
#endif /* !defined(isfinite)  */

I think it we need to cast both x variables in the macro to unsigned long.


-- 


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


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