From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14603 invoked by alias); 16 Feb 2014 20:49:56 -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 14572 invoked by uid 48); 16 Feb 2014 20:49:53 -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: Sun, 16 Feb 2014 20:49: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: 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/msg01607.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60128 --- Comment #5 from Dominique d'Humieres --- While the patch in comment 4 fixed they PR, it was quite hawkish and did not explained the problem. After a deeper analysis it turns out that it is yet another "off by one bug" fixed by the following one liner: --- ../_clean/libgfortran/io/write_float.def 2014-01-21 08:30:57.000000000 +0100 +++ libgfortran/io/write_float.def 2014-02-16 20:56:56.000000000 +0100 @@ -1204,7 +1200,7 @@ determine_en_precision (st_parameter_dt if (nprinted == -1) return -1; - int e = atoi (&buffer[5]); + int e = atoi (&buffer[4]); int nbefore; /* digits before decimal point - 1. */ if (e >= 0) nbefore = e % 3; as &buffer[5] does not include the sign of the exponent.