From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10557 invoked by alias); 18 Jan 2014 16:46:50 -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 10521 invoked by uid 48); 18 Jan 2014 16:46:45 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/59836] [4.7/4.8/4.9 Regression] Wrong outputs with rounding formats for some values. Date: Sat, 18 Jan 2014 16:46: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: wrong-code 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-01/txt/msg01981.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59836 Dominique d'Humieres changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org --- Comment #5 from Dominique d'Humieres --- The line if (w > 0 && d == 0 && p == 0) has been introduced at r173408 and obviously the first code in comment 0 has started to give the wrong output after it. The second code in comment 0 has started to give the wrong output after r185433 (so far I did not try to understand why). Note that the block if (nbefore + nafter == 0) { ndigits = 0; if (nzero_real == d && digits[0] >= rchar) { /* We rounded to zero but shouldn't have */ nzero--; nafter = 1; digits[0] = '1'; ndigits = 1; } is present in the first version of libgfortran/io/write_float.def (r128114) with char replaced with '5' (the change was introduced at r152263).