------- Comment #28 from fxcoudert at gcc dot gnu dot org 2008-02-21 13:50
-------
That 27-headed (and counting!) monster PR is really hard to deal with. Here is
some more information:
-- On powerpc-apple-darwin-9.2.0 (MacOS 10.5.2), the testcases in comments #0
(original report) and #10 gives correct results.
-- On powerpc-apple-darwin-9.2.0, however, the following C testcase:
#include <stdio.h>
#include <math.h>
#include <float.h>
int main ()
{
if (!isfinite(LDBL_MAX))
puts("LDBL_MAX should be finite!");
}
gives wrong results (printing out "LDBL_MAX should be finite!") with gcc-4.4
and the system gcc 4.0.1 (Apple Inc. build 5465). It works with the system gcc
3.3 20030304 (Apple Computer, Inc. build 1823). I've submitted it to Apple as
#5757007.
-- On powerpc-apple-darwin-9.2.0, HAVE_BROKEN_ISFINITE is not set, while
clearly it should! Digging out, it is because the testcase is run without
including math.h, and that makes it work (ie, if in the C testcase above, you
remove the line including <math.h>, the testcase passes!). Why HAVE_MATH_H is
not defined is beyond my understanding, but since it's the only place in
libgfortran where we actually worry about it, I suggest we simply remove it.
-- Working around the isfinite() bug above is possible by using
__builtin_isfinite(), which works fine. I think, however, we can't do that
unconditionally as, IIRC, not all targets are able to expand
__builtin_isfinite().
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32841