From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24962 invoked by alias); 11 Jun 2011 12:41:15 -0000 Received: (qmail 24949 invoked by uid 22791); 11 Jun 2011 12:41:14 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mta11.charter.net (HELO mta11.charter.net) (216.33.127.80) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Jun 2011 12:41:00 +0000 Received: from imp11 ([10.20.200.11]) by mta11.charter.net (InterMail vM.7.09.02.04 201-2219-117-106-20090629) with ESMTP id <20110611124058.VUAG29959.mta11.charter.net@imp11>; Sat, 11 Jun 2011 08:40:58 -0400 Received: from quava.localdomain ([68.186.96.128]) by imp11 with smtp.charter.net id ucgx1g0022mBQ6U05cgxG2; Sat, 11 Jun 2011 08:40:58 -0400 X-Authority-Analysis: v=1.1 cv=vT9vkN3vVXssH3Ov7r/wQUs/sfIFjNPEFFf4aeKIi4A= c=1 sm=1 a=qd9eegJWHRQA:10 a=tCKlK9Mz1gsA:10 a=yUnIBFQkZM0A:10 a=8nJEP1OIZ-IA:10 a=W3wzxSix39fL1hz8i2isiQ==:17 a=OI47DeLntTV6t7wd-7wA:9 a=t_WU2I_ckR88VdH4ibkA:7 a=wPNLvfGTeEIA:10 a=a4vCzhIiUvyQSZN0:21 a=PypPcFq6la7un4X4:21 a=W3wzxSix39fL1hz8i2isiQ==:117 Message-ID: <4DF3626B.6070404@charter.net> Date: Sat, 11 Jun 2011 14:19:00 -0000 From: jerry DeLisle User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 To: Thomas Henlich CC: Janne Blomqvist , gfortran , gcc patches Subject: Re: [patch, libgfortran] PR48906 Wrong rounding results with -m32 References: <4DE8D8D6.5030506@charter.net> <4DF25409.1080509@charter.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00904.txt.bz2 On 06/11/2011 12:23 AM, Thomas Henlich wrote: >> I don't agree with this; with the patch we now output 10 significant >> digits, whereas 9 is sufficient for a binary->ascii->binary roundtrip. >> So please retain the "reduce d by one when E editing is used" thing >> for list format and G0. This is just a side effect of using 1PGw.d >> format for list format and G0 in order to avoid duplicating code, but >> we don't need to follow this particular craziness that is due to how >> the scale factor is specified in the standard. > > I hadn't noticed this, but I agree with Janne. > > It should be easy to implement: > > After the switch between F and E editing, we just need to shift the > decimal point and decrement the exponent. No new rounding is required, > because we keep the number of significant digits. > Our default formats for kind=4 are: static void set_fnode_default (st_parameter_dt *dtp, fnode *f, int length) { f->format = FMT_G; switch (length) { case 4: f->u.real.w = 16; f->u.real.d = 9; f->u.real.e = 2; break; This was established as solution to PR48488 where we had two choices for selecting the significant digits. Nine significant digits was established as a requirement to guarantee round trip in all cases. The char4_iunit_1.f03 test case was revised because after we corrected the formatting in PR48906, it started to fail and I observed the test case was looking for the wrong number of significant digits. Based on this, I would suggest we leave it as I have it, which is correct. Jerry