From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27045 invoked by alias); 6 Jun 2011 08:38:36 -0000 Received: (qmail 26768 invoked by uid 22791); 6 Jun 2011 08:38:34 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 08:38:17 +0000 From: "thenlich at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/48906] Wrong rounding results with -m32 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: thenlich at users dot sourceforge.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 06 Jun 2011 08:38:00 -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 X-SW-Source: 2011-06/txt/msg00367.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48906 --- Comment #24 from Thomas Henlich 2011-06-06 08:38:13 UTC --- (In reply to comment #23) > Patch submitted to list for approval. For a scale factor 0, we are done. Good work, thank you! A scale factor != 0 does not work yet, you wrote you are still working on it, is that correct? print "(-2pg12.3)", 0.02 ! 0.200E-01 expected 0.002E+01 print "(-1pg12.3)", 0.02 ! 0.200E-01 expected 0.020E+00 print "(0pg12.3)", 0.02 ! 0.200E-01 print "(1pg12.3)", 0.02 ! 0.200E-01 expected 2.000E-02 print "(2pg12.3)", 0.02 ! 0.200E-01 expected 20.00E-03 --- gcc/testsuite/gfortran.dg/pr20755.f (revision 174320) +++ gcc/testsuite/gfortran.dg/pr20755.f (working copy) @@ -5,8 +5,8 @@ character*30 s write (s,2000) 0.0, 0.02 - if (s .ne. " 0.00 2.000E-02") call abort + if (s .ne. " 0.00 0.200E-01") call abort write (s,2000) 0.01, 0.02 - if (s .ne. " 1.000E-02 2.000E-02") call abort + if (s .ne. " 0.100E-01 0.200E-01") call abort 2000 format (1PG12.3,G12.3) end I don't agree with the changes to this testcase, since the scale factor does not work yet, and the test was correct before. --- gcc/testsuite/gfortran.dg/fmt_g0_6.f08 (revision 174320) +++ gcc/testsuite/gfortran.dg/fmt_g0_6.f08 (working copy) @@ -57,7 +57,7 @@ contains do dec = d, 0, -1 lower = 10.0_RT ** (d - 1 - dec) - r * 10.0_RT ** (- dec - 1) upper = 10.0_RT ** (d - dec) - r * 10.0_RT ** (- dec) - if (lower <= mag .and. mag < upper) then + if (lower < mag .and. mag <= upper) then write(fmt_f, "('R', a, ',F', i0, '.', i0, ',', i0, 'X')") roundmode, w - n, dec, n exit end if I don't agree with this change, since it was according to the Fortran standard before (it does not actually make a difference for the values we currently check in this test, though.)