From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27056 invoked by alias); 30 Jul 2013 17:31:08 -0000 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 Received: (qmail 26926 invoked by uid 48); 30 Jul 2013 17:31:03 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/58020] Code for handling IEEE exceptions Date: Tue, 30 Jul 2013 17:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg01506.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58020 --- Comment #7 from Dominique d'Humieres --- > I see your bug report. There are two matters to track down here. > The first one is the diagnostic of 'PR58027'. This may require you > to report a line number. That would be great. Testing that I have > done is with the gfortran compiler on Krogh's machine and my own > with the Intel compiler. I do not have access to the machine you > are using. The ICE leading to PR58027 is [macbook] bug/IEEE_1% gfc -c IEEE_tests_gfortran.f90 IEEE_tests_gfortran.f90: In function 'ieee_tests': IEEE_tests_gfortran.f90:304:0: internal compiler error: in gfc_conv_array_initializer, at fortran/trans-array.c:5512 SA=transfer(ISCLASS(I),SA) However any use of ISCLASS leads to the ICE because the parameter array is not built. To understand why, I have compiled the following test integer, parameter :: isclass = Z'FF800000' end and got isclass_2.f90:1.35: integer, parameter :: isclass = Z'FF800000' 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(4) at (1). This check can be disabled with the option -fno-range-check with -m64 and isclass_2.f90:1.35: integer, parameter :: isclass = Z'FF800000' 1 Error: Arithmetic overflow converting INTEGER(8) to INTEGER(4) at (1). This check can be disabled with the option -fno-range-check with -m32. The gfortran rationale is that Z'FF800000' is converted to the highest integer kind (8 with -m32 or 16 with -m64) as 2**32-8388608, i.e., a positive number larger that huge(1)=2**31-1. > The second matter is the difference in a line of output. That is the > printing of the 4 digit approximation to \pi. The internal constant \pi > itself comes from the stored value in the x87. The output of the number > comes from the routine messy. I expect the hardware value is correct. So > one machine writes 3.141 wit messy, and the other 3.142. Apparently 'CALL IEEE_SET_ROUNDING_MODE(IEEE_TO_ZERO)' propagates into call messy(E,'$N Double precision rounding mode IEEE_DOWN& & for \pi ~= $R agrees with IEEE_TO_ZERO.',rdat=[DA]) If I add CALL IEEE_SET_ROUNDING_MODE(IEEE_NEAREST) before the line IF(DC == DA) THEN ! Round down should agree withround to zero, here. then my output matches the one in list.