From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14090 invoked by alias); 10 Feb 2014 09:52:23 -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 14048 invoked by uid 48); 10 Feb 2014 09:52:20 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/60128] [4.8/4.9 Regression] Wrong ouput using en edit descriptor Date: Mon, 10 Feb 2014 09:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran 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: cc 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-02/txt/msg00945.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60128 Dominique d'Humieres changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org, | |jvdelisle at gcc dot gnu.org --- Comment #2 from Dominique d'Humieres --- This likely due to r185433. This fixed by the following patch --- ../_clean/libgfortran/io/write_float.def 2014-01-21 08:30:57.000000000 +0100 +++ libgfortran/io/write_float.def 2014-02-10 10:23:13.000000000 +0100 @@ -1215,8 +1211,8 @@ determine_en_precision (st_parameter_dt nbefore = 3 - nbefore; } int prec = f->u.real.d + nbefore; - if (dtp->u.p.current_unit->round_status != ROUND_UNSPECIFIED - && dtp->u.p.current_unit->round_status != ROUND_PROCDEFINED) + /* if (dtp->u.p.current_unit->round_status != ROUND_UNSPECIFIED + && dtp->u.p.current_unit->round_status != ROUND_PROCDEFINED) */ prec += 2 * len + 4; return prec; } For the following extended test write(*,"(en15.2)") -.44444 write(*,"(rp,en15.2)") -.44444 write(*,"(rc,en15.2)") -.44444 write(*,"(rz,en15.2)") -.44444 write(*,"(rd,en15.2)") -.44444 write(*,"(en15.2)") -.44446 write(*,"(en15.1)") -.44444 end before the patch, the output is -444.40E-03 -444.40E-03 -444.44E-03 -444.44E-03 -444.45E-03 -444.50E-03 -444.0E-03 after the patch, it is -444.44E-03 -444.44E-03 -444.44E-03 -444.44E-03 -444.45E-03 -444.46E-03 -444.4E-03 Regtesting in progress. Note that the block - if (dtp->u.p.current_unit->round_status != ROUND_UNSPECIFIED - && dtp->u.p.current_unit->round_status != ROUND_PROCDEFINED) appears in several places in libgfortran/io/write_float.def and I fail to see the logic.