public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38398]  New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes
@ 2008-12-04 12:33 burnus at gcc dot gnu dot org
  2008-12-04 12:34 ` [Bug fortran/38398] " burnus at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-12-04 12:33 UTC (permalink / raw)
  To: gcc-bugs

The current g0.w edit descriptor implementation is based on the F2008 comment
resolution at J3 resolution. Afterwards there was the Tokyo WG5, which also
addressed ISO member comments. Unfortunately, the g0.<w> was changed a bit.

At the WG5 meeting in Tokyo, one agreed on the following modified version, see
ftp://ftp.nag.co.uk/sc22wg5/N1751-N1800/N1760.txt:
"2.6 Generalized output editing
 A similar feature has been added, see 08-296r2."

That is the following paper:
  http://www.j3-fortran.org/doc/year/08/08-296r2.txt

I think the current implementation (see PR 37228) is based on
     http://j3-fortran.org/doc/year/08/08-251r3.txt
and  http://www.j3-fortran.org/doc/year/08/08-272.html


"In the original J3 response, 08-251r3, G0.d, like G0, was defined in
 terms of the ESw.d format, meaning that even values close to zero
 would be shown in E format, unlike the Gw.d format (for w>0) which
 would choose F format for such values.  N1743 suggested that G0 and
 G0.d behave more like Gw.d in such cases and J3 agrees."

Currently, gfortran prints:

3.4500E+00   ES10.4
    3.4500   F10.4
 3.450       g10.4
     3.4500E+00   g0.4

Note that contrary to the other edit descriptors:
 "that any leading or trailing blanks are removed.

If I read the new proposal correctly, the out should not be:
"3.450" without heading spaces.

 * * *

Per C1007+, the e<d> may not be specified for g0, e.g.
 "g0.4e4"
gfortran rejects this, but with a rather strange error message:
print '(g0.4e4)',   3.45
                       1
Error: Period required in format specifier at (1)


-- 
           Summary: g0.w edit descriptor: Update for F2008 Tokyo meeting
                    changes
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
@ 2008-12-04 12:34 ` burnus at gcc dot gnu dot org
  2008-12-13 21:10 ` jvdelisle at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-12-04 12:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-12-04 12:32 -------
Jerry, I've created this PR to make sure it won't get forgotten.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu dot
                   |                            |org


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
  2008-12-04 12:34 ` [Bug fortran/38398] " burnus at gcc dot gnu dot org
@ 2008-12-13 21:10 ` jvdelisle at gcc dot gnu dot org
  2008-12-13 21:20 ` jvdelisle at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-13 21:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2008-12-13 21:08 -------
Please confirm.  Is the output for this correct?

write(*, '(g0.3)') 0.1
write(*, '(g0.9)') 1.0
write(*, '(g0.5)') 29.23
write(*, '(g0.8)') -28.4
write(*, '(g0.8)') -0.0001
write(*, '(a,g10.4,a)') ">",3.45,"<"
write(*, '(g0.4)') 3.45
end

          0.100
    1.000000000
       29.23000
   -28.39999962
    -0.00010000
> 3.450    <
         3.4500


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
  2008-12-04 12:34 ` [Bug fortran/38398] " burnus at gcc dot gnu dot org
  2008-12-13 21:10 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-13 21:20 ` jvdelisle at gcc dot gnu dot org
  2008-12-13 23:55 ` jvdelisle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-13 21:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2008-12-13 21:19 -------
Disregard comment #2, I found the relevant text describing this that I needed.


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-12-13 21:20 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-13 23:55 ` jvdelisle at gcc dot gnu dot org
  2008-12-20 18:35 ` jvdelisle at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-13 23:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2008-12-13 23:54 -------
Let's try this again.  I need verification that I am interpreting the comments
correctly.  With this:

! { dg-do compile }
! { dg-options "-std=f2008" }
! PR36725 Compile time error for g0 edit descriptor
write(*, '(g0.3)') 0.1
write(*, '(g0.9)') 1.0
write(*, '(g0.5)') 29.23
write(*, '(g0.8)') -28.4
write(*, '(5(g0.8,1x))') -0.0001, 2.307, ">",3.45,"<"
write(*, '(2(f0.8,1x))') -0.0001, 2.307
write(*, '(a,g10.4,a)') ">",3.45,"<"
write(*, '(a,g0.4,a)') ">",3.45,"<"
write(*, '(a,f0.4,a)') ">",3.45,"<"
end

I get the following output:

$ ./a.out 
.100
1.000000000
29.23000
-28.39999962
-.00010000 2.30699992 > 3.45000005 <
-.00010000 2.30699992
> 3.450    <
>3.4500<
>3.4500<


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-12-13 23:55 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-20 18:35 ` jvdelisle at gcc dot gnu dot org
  2008-12-21 21:23 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-20 18:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2008-12-20 18:34 -------
Created an attachment (id=16950)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16950&action=view)
Revised patch

This is latest version of the patch.  Please test.


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-12-20 18:35 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-21 21:23 ` jvdelisle at gcc dot gnu dot org
  2008-12-21 21:26 ` jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-21 21:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2008-12-21 21:21 -------
Subject: Bug 38398

Author: jvdelisle
Date: Sun Dec 21 21:20:29 2008
New Revision: 142870

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142870
Log:
2008-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/38398
        * io.c: Add error checks for g0 formatting and provide adjustment of
        error loci for improved error messages.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/io.c


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-12-21 21:23 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-21 21:26 ` jvdelisle at gcc dot gnu dot org
  2008-12-21 22:09 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-21 21:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2008-12-21 21:25 -------
Subject: Bug 38398

Author: jvdelisle
Date: Sun Dec 21 21:23:52 2008
New Revision: 142871

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142871
Log:
2008-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/38398
        * io/io.h (st_parameter_dt): Add new bit to keep track of when to
        suppress blanks for g0 formatting.
        * io/transfer.c (formatted_transfer_scalar): Always call write_real_g0
        for g0 formatting.
        * io.c (write.c): Do not use ES formatting and use new bit to suppress
        blanks.
        * io/write_float.def (output_float): Adjust the location of setting the
        width so that it can be adjusted when suppressing blanks.  Set number
of
        blanks to zero when dtp->u.p.g0_no_blanks is set. Do some minor code
        clean-up and add some white space for readability.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/io.h
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/io/write.c
    trunk/libgfortran/io/write_float.def


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-12-21 21:26 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-21 22:09 ` jvdelisle at gcc dot gnu dot org
  2008-12-23 23:45 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-21 22:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2008-12-21 22:08 -------
Subject: Bug 38398

Author: jvdelisle
Date: Sun Dec 21 22:06:34 2008
New Revision: 142876

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142876
Log:
2008-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/38398
        * gfortran.dg/fmt_g0_1.f08: Revise.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/fmt_g0_1.f08


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-12-21 22:09 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-23 23:45 ` jvdelisle at gcc dot gnu dot org
  2008-12-27 23:06 ` mikael at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-23 23:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2008-12-23 23:43 -------
Closing, fixed on 4.4


-- 

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         |2008-12-23 23:43:09
               date|                            |
   Target Milestone|---                         |4.4.0


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-12-23 23:45 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-27 23:06 ` mikael at gcc dot gnu dot org
  2008-12-28  3:55 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-12-27 23:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from mikael at gcc dot gnu dot org  2008-12-27 23:05 -------
(In reply to comment #9)
> Closing, fixed on 4.4
> 
Not yet ;-)

I'm at revision 142934, and I get this on x86_64-unknown-linux-gnu:
FAIL: gfortran.dg/fmt_g0_1.f08  -O0  execution test
FAIL: gfortran.dg/fmt_g0_1.f08  -O1  execution test
FAIL: gfortran.dg/fmt_g0_1.f08  -O2  execution test
FAIL: gfortran.dg/fmt_g0_1.f08  -O3 -fomit-frame-pointer  execution test
FAIL: gfortran.dg/fmt_g0_1.f08  -O3 -fomit-frame-pointer -funroll-loops 
execution test
FAIL: gfortran.dg/fmt_g0_1.f08  -O3 -fomit-frame-pointer -funroll-all-loops
-finline-functions  execution test
FAIL: gfortran.dg/fmt_g0_1.f08  -O3 -g  execution test
FAIL: gfortran.dg/fmt_g0_1.f08  -Os  execution test



here is the ouput of the various writes in fmt_g0_1.f08:
:12340:
:0:
: 0.33333334    :
 : 0.33333334    :
:hello:
:TF:
(  1.2345001    ,  2.4567001    )


Was the commit in comment #8 needed ?


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-12-27 23:06 ` mikael at gcc dot gnu dot org
@ 2008-12-28  3:55 ` jvdelisle at gcc dot gnu dot org
  2008-12-28 19:21 ` mikael at gcc dot gnu dot org
  2008-12-29 20:51 ` jvdelisle at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-28  3:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2008-12-28 03:53 -------
Something is amiss. Yes the change to fmt_g0_1.f08 is necessary.  The output
should have no blank spaces in the fields for floating point.

This test case runs fine here, maybe your trunk is not fully updated?

$ cat fmt_g0_1.f08 
    character(25) :: string = "(g0,g0,g0)" 
    character(33) :: buffer
    write(*, '(g0,g0,g0)') ':',12340,':'
    write(*, string) ':',0,':'
    write(*, string) ':',1.0/3.0,':'
    write(*, '(1x,a,g0,a)') ':',1.0/3.0,':'
    write(*, string) ':',"hello",':'
    write(*, "(g0,g0,g0,g0)") ':',.true.,.false.,':'
    write(*, "(g0,g0,',',g0,g0)") '(',( 1.2345, 2.4567 ),')'
end

$ ./a.out 
:12340:
:0:
:.33333334:
 :.33333334:
:hello:
:TF:
(1.2345001,2.4567001)
$


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2008-12-28  3:55 ` jvdelisle at gcc dot gnu dot org
@ 2008-12-28 19:21 ` mikael at gcc dot gnu dot org
  2008-12-29 20:51 ` jvdelisle at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-12-28 19:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from mikael at gcc dot gnu dot org  2008-12-28 19:19 -------
(In reply to comment #11)
> This test case runs fine here, maybe your trunk is not fully updated?
It works with a fresh checkout and a fresh bootstrap.
My trunk was up to date; it was probably the dirty build tree trap again. 


-- 


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


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

* [Bug fortran/38398] g0.w edit descriptor: Update for F2008 Tokyo meeting changes
  2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2008-12-28 19:21 ` mikael at gcc dot gnu dot org
@ 2008-12-29 20:51 ` jvdelisle at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-12-29 20:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jvdelisle at gcc dot gnu dot org  2008-12-29 20:47 -------
I will try to close this again. :)


-- 

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=38398


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

end of thread, other threads:[~2008-12-29 20:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-04 12:33 [Bug fortran/38398] New: g0.w edit descriptor: Update for F2008 Tokyo meeting changes burnus at gcc dot gnu dot org
2008-12-04 12:34 ` [Bug fortran/38398] " burnus at gcc dot gnu dot org
2008-12-13 21:10 ` jvdelisle at gcc dot gnu dot org
2008-12-13 21:20 ` jvdelisle at gcc dot gnu dot org
2008-12-13 23:55 ` jvdelisle at gcc dot gnu dot org
2008-12-20 18:35 ` jvdelisle at gcc dot gnu dot org
2008-12-21 21:23 ` jvdelisle at gcc dot gnu dot org
2008-12-21 21:26 ` jvdelisle at gcc dot gnu dot org
2008-12-21 22:09 ` jvdelisle at gcc dot gnu dot org
2008-12-23 23:45 ` jvdelisle at gcc dot gnu dot org
2008-12-27 23:06 ` mikael at gcc dot gnu dot org
2008-12-28  3:55 ` jvdelisle at gcc dot gnu dot org
2008-12-28 19:21 ` mikael at gcc dot gnu dot org
2008-12-29 20:51 ` 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).