public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30910]  New: Gfortran: ES format not quite right...
@ 2007-02-21 12:52 pmason at ricardo dot com
  2007-02-21 14:32 ` [Bug fortran/30910] " jvdelisle at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: pmason at ricardo dot com @ 2007-02-21 12:52 UTC (permalink / raw)
  To: gcc-bugs

When printing using ES-format descriptor with
zero decimal places (e.g. ES6.0) get zero answer.
Sample code below, compiled as "gfortran test.f90",
using version 4.3.0 20070221 (experimental) on suse
9 linux box (64-bit).

-------------------------------------
 program esformat
 !This should print as "1.E-01"
 write(6,'(es6.0)') 1.0e-1
 end program esformat
-------------------------------------


-- 
           Summary: Gfortran: ES format not quite right...
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pmason at ricardo dot com
 GCC build triplet: 4.3.0 20070221 (experimental)
  GCC host triplet: suse9 x86_64
GCC target triplet: x86_64-unknown-linux-gnu


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
@ 2007-02-21 14:32 ` jvdelisle at gcc dot gnu dot org
  2007-02-21 14:52 ` [Bug fortran/30910] [Regression 4.2, 4.3] " burnus at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-21 14:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-02-21 14:32 -------
I wil investigate this.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-02-21 14:32:42
               date|                            |


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
  2007-02-21 14:32 ` [Bug fortran/30910] " jvdelisle at gcc dot gnu dot org
@ 2007-02-21 14:52 ` burnus at gcc dot gnu dot org
  2007-02-22  1:26 ` jvdelisle at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-21 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2007-02-21 14:51 -------
This is a regression. With 4.1.2 20070115 (prerelease) (SUSE Linux) I get
"1.E-01", but with today's 4.2 and 4.3 I get "0.E+00".


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to fail|                            |4.3.0 4.2.0
      Known to work|                            |4.1.2
            Summary|Gfortran: ES format not     |[Regression 4.2, 4.3]
                   |quite right...              |Gfortran: ES format not
                   |                            |quite right...


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
  2007-02-21 14:32 ` [Bug fortran/30910] " jvdelisle at gcc dot gnu dot org
  2007-02-21 14:52 ` [Bug fortran/30910] [Regression 4.2, 4.3] " burnus at gcc dot gnu dot org
@ 2007-02-22  1:26 ` jvdelisle at gcc dot gnu dot org
  2007-02-22  1:39 ` jvdelisle at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-22  1:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2007-02-22 01:26 -------
I fixed one similar to this not too long ago with E format.  I will dig that up
while I am at it.


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (2 preceding siblings ...)
  2007-02-22  1:26 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-22  1:39 ` jvdelisle at gcc dot gnu dot org
  2007-02-22 12:41 ` pmason at ricardo dot com
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-22  1:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2007-02-22 01:39 -------
Correction, it was F format with .0 decimal specification, pr28354.


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (3 preceding siblings ...)
  2007-02-22  1:39 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-22 12:41 ` pmason at ricardo dot com
  2007-02-22 13:50 ` burnus at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pmason at ricardo dot com @ 2007-02-22 12:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pmason at ricardo dot com  2007-02-22 12:40 -------
Get same problem with equivalent P/E format:

write(6,'(1pe6.0)') 1.0e-1


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (4 preceding siblings ...)
  2007-02-22 12:41 ` pmason at ricardo dot com
@ 2007-02-22 13:50 ` burnus at gcc dot gnu dot org
  2007-02-22 14:00 ` burnus at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-22 13:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2007-02-22 13:50 -------
I think I found why the output is wrong. The following condition has been
introduced 2006-08-27 with the patch
http://gcc.gnu.org/viewcvs?view=rev&revision=116502

Before the "if" the value is 0.1, afterwards it is 0.0.

  /* Special case when format specifies no digits after the decimal point.  */
  if (d == 0)
    {
      if (value < 0.5)
        value = 0.0;
      else if (value < 1.0)
        value = value + 0.5;
    }

The changelog of that patch is:
        PR libgfortran/28354
        * io/write.c: Check for special case of zero precision in format
        and pre-round the real value.

which fixed the bug "0.99999 printed as 0. instead of 1. by format(f3.0)"


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (5 preceding siblings ...)
  2007-02-22 13:50 ` burnus at gcc dot gnu dot org
@ 2007-02-22 14:00 ` burnus at gcc dot gnu dot org
  2007-02-22 14:23 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-22 14:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from burnus at gcc dot gnu dot org  2007-02-22 13:59 -------
Forget to mention: If I comment out that if-block, the output is correct
(1.E-01). Now you need only to fix it without breaking the other PR ;-)


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (6 preceding siblings ...)
  2007-02-22 14:00 ` burnus at gcc dot gnu dot org
@ 2007-02-22 14:23 ` jvdelisle at gcc dot gnu dot org
  2007-02-23  5:43 ` jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-22 14:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2007-02-22 14:23 -------
Thanks Tobias.  I suspected a connection with that patch.


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (7 preceding siblings ...)
  2007-02-22 14:23 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-23  5:43 ` jvdelisle at gcc dot gnu dot org
  2007-02-23  6:29 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-23  5:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2007-02-23 05:43 -------
Subject: Bug 30910

Author: jvdelisle
Date: Fri Feb 23 05:43:16 2007
New Revision: 122250

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122250
Log:
2007-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/30910
        * io/write.c (output_float): Add condition of format F only for
        special case rounding with zero precision.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/write.c


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (8 preceding siblings ...)
  2007-02-23  5:43 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-23  6:29 ` jvdelisle at gcc dot gnu dot org
  2007-02-23 18:13 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-23  6:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2007-02-23 06:29 -------
Subject: Bug 30910

Author: jvdelisle
Date: Fri Feb 23 06:29:03 2007
New Revision: 122251

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122251
Log:
2007-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/30910    
        * gfortran.dg/fmt_zero_precision.f90: Update test.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (9 preceding siblings ...)
  2007-02-23  6:29 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-23 18:13 ` jvdelisle at gcc dot gnu dot org
  2007-02-23 18:15 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-23 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2007-02-23 18:13 -------
Subject: Bug 30910

Author: jvdelisle
Date: Fri Feb 23 18:13:16 2007
New Revision: 122265

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122265
Log:
2007-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/30910
        * io/write.c (output_float): Add condition of format F only for
        special case rounding with zero precision.

Modified:
    branches/gcc-4_2-branch/libgfortran/ChangeLog
    branches/gcc-4_2-branch/libgfortran/io/write.c


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (10 preceding siblings ...)
  2007-02-23 18:13 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-23 18:15 ` jvdelisle at gcc dot gnu dot org
  2007-02-23 18:26 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-23 18:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jvdelisle at gcc dot gnu dot org  2007-02-23 18:15 -------
Subject: Bug 30910

Author: jvdelisle
Date: Fri Feb 23 18:15:27 2007
New Revision: 122266

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122266
Log:
2007-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/30910    
        * gfortran.dg/fmt_zero_precision.f90: Update test.

Modified:
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (11 preceding siblings ...)
  2007-02-23 18:15 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-23 18:26 ` jvdelisle at gcc dot gnu dot org
  2007-02-23 18:31 ` jvdelisle at gcc dot gnu dot org
  2007-02-23 18:35 ` jvdelisle at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-23 18:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jvdelisle at gcc dot gnu dot org  2007-02-23 18:26 -------
Subject: Bug 30910

Author: jvdelisle
Date: Fri Feb 23 18:26:23 2007
New Revision: 122270

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122270
Log:
2007-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/30910
        * io/write.c (output_float): Add condition of format F only for
        special case rounding with zero precision.

Modified:
    branches/gcc-4_1-branch/libgfortran/ChangeLog
    branches/gcc-4_1-branch/libgfortran/io/write.c


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (12 preceding siblings ...)
  2007-02-23 18:26 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-23 18:31 ` jvdelisle at gcc dot gnu dot org
  2007-02-23 18:35 ` jvdelisle at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-23 18:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jvdelisle at gcc dot gnu dot org  2007-02-23 18:31 -------
Subject: Bug 30910

Author: jvdelisle
Date: Fri Feb 23 18:30:57 2007
New Revision: 122271

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122271
Log:
2007-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/30910    
        * gfortran.dg/fmt_zero_precision.f90: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90
Modified:
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
  2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
                   ` (13 preceding siblings ...)
  2007-02-23 18:31 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-23 18:35 ` jvdelisle at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-23 18:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jvdelisle at gcc dot gnu dot org  2007-02-23 18:35 -------
Fixed on 4.1, 4.2, and 4.3


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-02-23 18:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-21 12:52 [Bug fortran/30910] New: Gfortran: ES format not quite right pmason at ricardo dot com
2007-02-21 14:32 ` [Bug fortran/30910] " jvdelisle at gcc dot gnu dot org
2007-02-21 14:52 ` [Bug fortran/30910] [Regression 4.2, 4.3] " burnus at gcc dot gnu dot org
2007-02-22  1:26 ` jvdelisle at gcc dot gnu dot org
2007-02-22  1:39 ` jvdelisle at gcc dot gnu dot org
2007-02-22 12:41 ` pmason at ricardo dot com
2007-02-22 13:50 ` burnus at gcc dot gnu dot org
2007-02-22 14:00 ` burnus at gcc dot gnu dot org
2007-02-22 14:23 ` jvdelisle at gcc dot gnu dot org
2007-02-23  5:43 ` jvdelisle at gcc dot gnu dot org
2007-02-23  6:29 ` jvdelisle at gcc dot gnu dot org
2007-02-23 18:13 ` jvdelisle at gcc dot gnu dot org
2007-02-23 18:15 ` jvdelisle at gcc dot gnu dot org
2007-02-23 18:26 ` jvdelisle at gcc dot gnu dot org
2007-02-23 18:31 ` jvdelisle at gcc dot gnu dot org
2007-02-23 18:35 ` jvdelisle at gcc dot gnu dot org

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).