This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/29302] nan_inf_fmt.f90 segfaults on Darwin PPC starting with Xcode 2.4
- From: "howarth at nitro dot med dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2006 04:33:03 -0000
- Subject: [Bug libfortran/29302] nan_inf_fmt.f90 segfaults on Darwin PPC starting with Xcode 2.4
- References: <bug-29302-11113@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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