From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2012 invoked by alias); 21 Feb 2008 13:50:48 -0000 Received: (qmail 1810 invoked by uid 48); 21 Feb 2008 13:50:03 -0000 Date: Thu, 21 Feb 2008 13:50:00 -0000 Message-ID: <20080221135003.1809.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/32841] [4.3/4.4 regression] HUGE(1.0_16) output as +Infinity on ppc-darwin8 (gfortran.dg/large_real_kind_2.F90) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fxcoudert at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-02/txt/msg02218.txt.bz2 ------- 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 #include #include 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 , 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