public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
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 11:36:00 -0000	[thread overview]
Message-ID: <bug-60128-4-eZ8kHBfUT7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60128-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60128

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The regression reported in comment 3 disappears with 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 11:35:55.000000000 +0100

@@ -326,7 +322,7 @@ output_float (st_parameter_dt *dtp, cons
      for IEEE 754, this ought to be round to nearest, ties to
      even, corresponding to the Fortran ROUND='NEAREST'.  */
       case ROUND_PROCDEFINED: 
-      case ROUND_UNSPECIFIED:
+      /* case ROUND_UNSPECIFIED: */
       case ROUND_ZERO: /* Do nothing and truncation occurs.  */
     goto skip;
       case ROUND_UP:
@@ -338,6 +334,7 @@ output_float (st_parameter_dt *dtp, cons
       goto skip;
     goto updown;
       case ROUND_NEAREST:
+      case ROUND_UNSPECIFIED:
     /* Round compatible unless there is a tie. A tie is a 5 with
        all trailing zero's.  */
     i = nafter + nbefore;
@@ -1215,8 +1212,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;
 }

>From the comment

      /* For processor defined and unspecified rounding we use
         snprintf to print the exact number of digits needed, and thus
         let snprintf handle the rounding.  On system claiming support
         for IEEE 754, this ought to be round to nearest, ties to
         even, corresponding to the Fortran ROUND='NEAREST'.  */
      case ROUND_PROCDEFINED:
      case ROUND_UNSPECIFIED:
      case ROUND_ZERO: /* Do nothing and truncation occurs.  */

I think it is wrong to handle ROUND_PROCDEFINED and ROUND_UNSPECIFIED as
ROUND_ZERO.


  parent reply	other threads:[~2014-02-10 11:36 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10  1:08 [Bug fortran/60128] New: " walt.brainerd at gmail dot com
2014-02-10  7:41 ` [Bug fortran/60128] [4.8/4.9 Regression] " dominiq at lps dot ens.fr
2014-02-10  9:52 ` dominiq at lps dot ens.fr
2014-02-10 10:15 ` dominiq at lps dot ens.fr
2014-02-10 11:36 ` dominiq at lps dot ens.fr [this message]
2014-02-16 20:49 ` dominiq at lps dot ens.fr
2014-02-17 14:44 ` dominiq at lps dot ens.fr
2014-02-18 10:51 ` dominiq at lps dot ens.fr
2014-02-24  9:33 ` rguenth at gcc dot gnu.org
2014-03-01 23:20 ` burnus at gcc dot gnu.org
2014-03-02  0:01 ` jvdelisle at gcc dot gnu.org
2014-03-08  6:05 ` jvdelisle at gcc dot gnu.org
2014-03-16  0:18 ` jvdelisle at gcc dot gnu.org
2014-03-16  0:35 ` jvdelisle at gcc dot gnu.org
2014-03-16  0:38 ` jvdelisle at gcc dot gnu.org
2014-03-18 10:27 ` ro at gcc dot gnu.org
2014-03-18 10:59 ` dominiq at lps dot ens.fr
2014-03-18 11:04 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-18 11:07 ` dominiq at lps dot ens.fr
2014-03-18 12:09 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-18 12:31 ` dominiq at lps dot ens.fr
2014-03-18 13:16 ` jvdelisle at gcc dot gnu.org
2014-03-18 13:23 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-18 13:26 ` dominiq at lps dot ens.fr
2014-03-18 17:11 ` dominiq at lps dot ens.fr
2014-03-19  1:41 ` jvdelisle at gcc dot gnu.org
2014-03-19  9:30 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-19  9:32 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-20 11:04 ` dominiq at lps dot ens.fr
2014-03-20 12:47 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-20 15:36 ` dominiq at lps dot ens.fr
2014-03-20 15:43 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-20 15:49 ` dominiq at lps dot ens.fr
2014-03-20 15:53 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-20 17:30 ` dominiq at lps dot ens.fr
2014-03-21 10:12 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-24  0:25 ` jvdelisle at gcc dot gnu.org
2014-03-24  0:30 ` jvdelisle at gcc dot gnu.org
2014-03-25 14:40 ` danglin at gcc dot gnu.org
2014-03-25 15:15 ` dominiq at lps dot ens.fr
2014-03-26  1:29 ` dave.anglin at bell dot net
2014-03-26 12:24 ` dave.anglin at bell dot net
2014-03-26 12:51 ` dominiq at lps dot ens.fr
2014-03-26 14:14 ` dave.anglin at bell dot net
2014-03-26 15:09 ` dominiq at lps dot ens.fr
2014-03-26 15:26 ` dave.anglin at bell dot net
2014-03-26 16:34 ` dominiq at lps dot ens.fr
2014-03-26 18:07 ` dominiq at lps dot ens.fr
2014-03-26 19:43 ` dave.anglin at bell dot net
2014-03-26 19:57 ` dave.anglin at bell dot net
2014-03-26 20:20 ` dominiq at lps dot ens.fr
2014-03-26 20:41 ` dave.anglin at bell dot net
2014-03-27 15:00 ` dominiq at lps dot ens.fr
2014-03-27 15:39 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-03-27 16:04 ` dave.anglin at bell dot net
2014-03-27 22:31 ` dominiq at lps dot ens.fr
2014-03-28  1:03 ` jvdelisle at gcc dot gnu.org
2014-03-28  1:05 ` dave.anglin at bell dot net
2014-03-29 16:12 ` dominiq at lps dot ens.fr
2014-03-29 19:00 ` dave.anglin at bell dot net
2014-03-29 23:30 ` dominiq at lps dot ens.fr
2014-03-29 23:52 ` dave.anglin at bell dot net
2014-03-31 11:28 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-04-01 13:32 ` [Bug fortran/60128] [4.8 " dominiq at lps dot ens.fr
2014-04-04  6:51 ` dominiq at lps dot ens.fr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60128-4-eZ8kHBfUT7@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).