From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27666 invoked by alias); 12 Jan 2014 01:48:57 -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 25949 invoked by uid 48); 12 Jan 2014 01:48:51 -0000 From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/59774] [Regression] Inconsistent rounding between -m32 and -m64 Date: Sun, 12 Jan 2014 01:48: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc 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: 2014-01/txt/msg01256.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59774 Jerry DeLisle changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Inconsistent rounding |[Regression] Inconsistent |between -m32 and -m64 |rounding between -m32 and | |-m64 --- Comment #2 from Jerry DeLisle --- I think this gets back to: http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=185433 Using: print "(ru,g11.2)", 99._8 print "(ru,g11.2)", 99._4 end Looking at the buffer in output_float we get: $ gfc -m32 pr59771.f90 $ ./a.out buffer=+99900000000000000000000e+01<<< 0.99E+02 buffer=+99.000000000000<<< 10. $ gfc -m64 pr59771.f90 $ ./a.out buffer=+99900000000000000000000e+01<<< 0.99E+02 buffer=+999000000000000e+01<<< 0.99E+02 Notice the '.' in the buffer for kind=4 vs kind=8 I don't know all the reasons for the changes made, but think "." needs to get stripped out before we ever get to output_float and the exponent needs to be there. I do recall the reason gfortran does its own rounding is because the C implementations across platforms are not consistent.