public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39072]  New: I/O READing logical value beyond end of string
@ 2009-02-01 23:08 burnus at gcc dot gnu dot org
  2009-02-01 23:09 ` [Bug fortran/39072] " burnus at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-02-01 23:08 UTC (permalink / raw)
  To: gcc-bugs

This might end up at "won't fix". I don't know whether the program is invalid
(I wouldn't wonder if it were).

Using ifort 11.1, openf95, sunf95, pathf95 and pgif95 the attached program
shows as last logical value "F".
Using NAG f95, g95 and gfortran, it aborts while reading the last logical.
(g77 also fails, but it also fails for the valid (commented out) test case.)


-- 
           Summary: I/O READing logical value beyond end of string
           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=39072


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

* [Bug fortran/39072] I/O READing logical value beyond end of string
  2009-02-01 23:08 [Bug fortran/39072] New: I/O READing logical value beyond end of string burnus at gcc dot gnu dot org
@ 2009-02-01 23:09 ` burnus at gcc dot gnu dot org
  2009-02-01 23:18 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-02-01 23:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2009-02-01 23:09 -------
Created an attachment (id=17226)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17226&action=view)
Test case


-- 


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


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

* [Bug fortran/39072] I/O READing logical value beyond end of string
  2009-02-01 23:08 [Bug fortran/39072] New: I/O READing logical value beyond end of string burnus at gcc dot gnu dot org
  2009-02-01 23:09 ` [Bug fortran/39072] " burnus at gcc dot gnu dot org
@ 2009-02-01 23:18 ` burnus at gcc dot gnu dot org
  2009-02-03  4:43 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-02-01 23:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2009-02-01 23:18 -------
If one reads an integer ("i1") instead of a logical variable ("l1"),
gfortran/g95/f95 read a "0".

 * * *

"10.6.2 Logical editing" makes it quite explicit that it is invalid:

"The input field consists of optional blanks, optionally followed by a period,
followed by a T for true or F for false. The T or F may be followed by
additional characters in the field, which are ignored. A lower-case letter is
equivalent to the corresponding upper-case letter in a logical input field."

Regarding "i1":
"10.6.1 Numeric editing": "On input, [...] A field containing only blanks is
considered to be zero."


-- 


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


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

* [Bug fortran/39072] I/O READing logical value beyond end of string
  2009-02-01 23:08 [Bug fortran/39072] New: I/O READing logical value beyond end of string burnus at gcc dot gnu dot org
  2009-02-01 23:09 ` [Bug fortran/39072] " burnus at gcc dot gnu dot org
  2009-02-01 23:18 ` burnus at gcc dot gnu dot org
@ 2009-02-03  4:43 ` jvdelisle at gcc dot gnu dot org
  2009-02-03 10:02 ` burnus at gcc dot gnu dot org
  2009-02-04  1:55 ` jvdelisle at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-02-03  4:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2009-02-03 04:43 -------
I believe gfortran is correct as far as giving an error.  The last logical
value does not begin with a T(t) or F(f).

On the commented out case gfortran agrees with g77.  The string has one extra
space in it so it misses the 1 character wide logical field.  Adjusting that
one byte, both gfortran and g77 get a valid read.

The only thing remaining here to me is are we attempting to read past the end
of record with the error case and so should we really be giving an EOR.


-- 


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


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

* [Bug fortran/39072] I/O READing logical value beyond end of string
  2009-02-01 23:08 [Bug fortran/39072] New: I/O READing logical value beyond end of string burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-02-03  4:43 ` jvdelisle at gcc dot gnu dot org
@ 2009-02-03 10:02 ` burnus at gcc dot gnu dot org
  2009-02-04  1:55 ` jvdelisle at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-02-03 10:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2009-02-03 10:02 -------
> I believe gfortran is correct as far as giving an error.  The last logical
> value does not begin with a T(t) or F(f).

That was my impression in comment 0 ("maybe wontfix"), which was confirmed by
the standard (comment 2); when I filled I was unsure since so many compilers
support it. (I encountered it in Fleur (www.flapw.de) and it took me a while to
figure out what was wrong.)

> The only thing remaining here to me is are we attempting to read past the end
> of record with the error case and so should we really be giving an EOR.

Hmm, I wonder whether it should be EOR. NAG f95 and g95 also give an error for
an invalid logical and not an EOR.
("No value found in LOGICAL input field", "Bad value on logical read")

Testing for "iostat=" using IS_IOSTAT_EOR(I),IS_IOSTAT_END(I), gives with all
three compilers a F(alse).

Thus, I would suggest WONTFIX.


-- 


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


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

* [Bug fortran/39072] I/O READing logical value beyond end of string
  2009-02-01 23:08 [Bug fortran/39072] New: I/O READing logical value beyond end of string burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-02-03 10:02 ` burnus at gcc dot gnu dot org
@ 2009-02-04  1:55 ` jvdelisle at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-02-04  1:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2009-02-04 01:55 -------
I agree, closing.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


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


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

end of thread, other threads:[~2009-02-04  1:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-01 23:08 [Bug fortran/39072] New: I/O READing logical value beyond end of string burnus at gcc dot gnu dot org
2009-02-01 23:09 ` [Bug fortran/39072] " burnus at gcc dot gnu dot org
2009-02-01 23:18 ` burnus at gcc dot gnu dot org
2009-02-03  4:43 ` jvdelisle at gcc dot gnu dot org
2009-02-03 10:02 ` burnus at gcc dot gnu dot org
2009-02-04  1:55 ` 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).