public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "harper at msor dot vuw.ac.nz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/105473] semicolon allowed when list-directed read integer with decimal='point'
Date: Fri, 03 Jun 2022 09:11:45 +0000	[thread overview]
Message-ID: <bug-105473-4-gVlZia0gy6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105473-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105473

--- Comment #21 from harper at msor dot vuw.ac.nz ---
I have only one problem here, and it's with the f2018 standard seeming
to contradict itself in two places that both apply to this program.

12.11.1 begins "The set of input/output error conditions is processor 
dependent. Except as otherwise specified, when an error condition occurs 
or is detected is processor dependent."

12.11.2 (6) says "if the statement is a READ statement or the error 
condition occurs in a wait operation for a transfer initiated by a READ
statement, all input items or namelist group objects in the statement that
initiated the transfer become undefined;"

In the 3rd case below, the output

  i== 2  input="2;5," with point x =   2.0  999.0 ERR

seems to me OK by 12.11.1 (error condition occurring after reading x(1)
as 2.0) but 12.11.2 seems to imply that neither x(1) nor x(2) should 
be read, making the output

  i= 2  input="2;5," with point x =  666.0  999.0 ERR

That is what ifort did with the program, but if the standard is ambiguous
I can't complain if gfortran and ifort interpret it differently. There is
of course also the cop-out that if the program is not standard-compliant
then compilers can do what they like with it.

The other cases where gfortran and ifort disagreed are listed below. 
They all involve point and ERR. I give the gfortran result first 
then the ifort result.

  i= 5  input="2,5;" with point x =    2.0    5.0 ERR
  i= 5  input="2,5;" with point x =    2.0  999.0 ERR

  i= 6  input="2;5;" with point x =    2.0  999.0 ERR
  i= 6  input="2;5;" with point x =  666.0  999.0 ERR

  i= 7  input="2 5;" with point x =    2.0    5.0 ERR
  i= 7  input="2 5;" with point x =    2.0  999.0 ERR

  i= 8  input="2.5;" with point x =    2.5  999.0 ERR
  i= 8  input="2.5;" with point x =  666.0  999.0 ERR

  i=10  input="2;5 " with point x =    2.0  999.0 ERR
  i=10  input="2;5 " with point x =  666.0  999.0 ERR

  i=14  input="2;5." with point x =    2.0  999.0 ERR
  i=14  input="2;5." with point x =  666.0  999.0 ERR

Oddly, there was one point and ERR case where gfortran agreed with ifort:

  i=16  input="2.5." with point x =  666.0  999.0 ERR

I wish I still had access to the NAG compiler!


> Date: Fri, 3 Jun 2022 04:33:33 +0000
> From: jvdelisle at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
> To: John Harper <john.harper@vuw.ac.nz>
> Subject: [Bug fortran/105473] semicolon allowed when list-directed read
>     integer with decimal='point'
> Resent-Date: Fri, 3 Jun 2022 16:33:45 +1200 (NZST)
> Resent-From: <john.harper@vuw.ac.nz>
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105473
>
> --- Comment #20 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
> Please check this. Second pair of eyes needed.
>
> $ ./a.out
> i= 1  input="2,5," with point x =    2.0    5.0  OK
> i= 1  input="2,5," with comma x =  666.0  999.0 ERR
>
> i= 2  input="2;5," with point x =    2.0  999.0 ERR
> i= 2  input="2;5," with comma x =    2.0    5.0  OK
>
> i= 3  input="2 5," with point x =    2.0    5.0  OK
> i= 3  input="2 5," with comma x =    2.0    5.0  OK
>
> i= 4  input="2.5," with point x =    2.5  999.0 end
> i= 4  input="2.5," with comma x =  666.0  999.0 ERR
>
> i= 5  input="2,5;" with point x =    2.0    5.0 ERR
> i= 5  input="2,5;" with comma x =    2.5  999.0 end
>
> i= 6  input="2;5;" with point x =    2.0  999.0 ERR
> i= 6  input="2;5;" with comma x =    2.0    5.0  OK
>
> i= 7  input="2 5;" with point x =    2.0    5.0 ERR
> i= 7  input="2 5;" with comma x =    2.0    5.0  OK
>
> i= 8  input="2.5;" with point x =    2.5  999.0 ERR
> i= 8  input="2.5;" with comma x =  666.0  999.0 ERR
>
> i= 9  input="2,5 " with point x =    2.0    5.0  OK
> i= 9  input="2,5 " with comma x =    2.5  999.0 end
>
> i=10  input="2;5 " with point x =    2.0  999.0 ERR
> i=10  input="2;5 " with comma x =    2.0    5.0  OK
>
> i=11  input="2 5 " with point x =    2.0    5.0  OK
> i=11  input="2 5 " with comma x =    2.0    5.0  OK
>
> i=12  input="2.5 " with point x =    2.5  999.0 end
> i=12  input="2.5 " with comma x =  666.0  999.0 ERR
>
> i=13  input="2,5." with point x =    2.0    5.0  OK
> i=13  input="2,5." with comma x =  666.0  999.0 ERR
>
> i=14  input="2;5." with point x =    2.0  999.0 ERR
> i=14  input="2;5." with comma x =    2.0  999.0 ERR
>
> i=15  input="2 5." with point x =    2.0    5.0  OK
> i=15  input="2 5." with comma x =    2.0  999.0 ERR
>
> i=16  input="2.5." with point x =  666.0  999.0 ERR
> i=16  input="2.5." with comma x =  666.0  999.0 ERR
>
> -- 
> You are receiving this mail because:
> You reported the bug.
>


-- John Harper, School of Mathematics and Statistics
Victoria Univ. of Wellington, PO Box 600, Wellington 6140, New Zealand.
e-mail john.harper@vuw.ac.nz phone +64(0) 4 463 5276

  parent reply	other threads:[~2022-06-03  9:11 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  8:38 [Bug fortran/105473] New: " john.harper at vuw dot ac.nz
2022-05-05  2:14 ` [Bug fortran/105473] " jvdelisle2 at gmail dot com
2022-05-05  2:21 ` jvdelisle2 at gmail dot com
2022-05-05  2:50 ` harper at msor dot vuw.ac.nz
2022-05-06  1:26 ` jvdelisle2 at gmail dot com
2022-05-06 20:39 ` anlauf at gcc dot gnu.org
2022-05-08 14:54 ` jvdelisle at gcc dot gnu.org
2022-05-14 22:00 ` jvdelisle at gcc dot gnu.org
2022-05-15  8:59 ` harper at msor dot vuw.ac.nz
2022-05-15 14:37 ` jvdelisle at gcc dot gnu.org
2022-05-15 15:56 ` jvdelisle at gcc dot gnu.org
2022-05-16  0:10 ` harper at msor dot vuw.ac.nz
2022-05-16  0:42 ` jvdelisle at gcc dot gnu.org
2022-05-16  0:49 ` jvdelisle at gcc dot gnu.org
2022-05-16  0:55 ` jvdelisle at gcc dot gnu.org
2022-05-16  1:44 ` harper at msor dot vuw.ac.nz
2022-05-16  4:12 ` harper at msor dot vuw.ac.nz
2022-05-16 21:13 ` harper at msor dot vuw.ac.nz
2022-05-18  2:52 ` jvdelisle at gcc dot gnu.org
2022-05-19  0:10 ` harper at msor dot vuw.ac.nz
2022-06-03  4:33 ` jvdelisle at gcc dot gnu.org
2022-06-03  9:11 ` harper at msor dot vuw.ac.nz [this message]
2022-06-03 21:04 ` jvdelisle at gcc dot gnu.org
2022-06-04  3:47 ` harper at msor dot vuw.ac.nz
2022-07-02 17:14 ` jvdelisle at gcc dot gnu.org
2022-07-03  3:52 ` harper at msor dot vuw.ac.nz
2022-07-04  3:48 ` jvdelisle at gcc dot gnu.org
2024-02-17 18:04 ` cvs-commit at gcc dot gnu.org
2024-03-08  0:29 ` cvs-commit at gcc dot gnu.org
2024-03-08  0:30 ` jvdelisle at gcc dot gnu.org
2024-03-08  7:21 ` john.harper at vuw dot ac.nz
2024-03-09 19:12 ` jvdelisle at gcc dot gnu.org
2024-03-11 12:48 ` burnus at gcc dot gnu.org
2024-03-11 22:48 ` jvdelisle at gcc dot gnu.org
2024-03-14  8:40 ` burnus at gcc dot gnu.org
2024-03-14  9:16 ` burnus at gcc dot gnu.org
2024-04-03  3:36 ` jvdelisle at gcc dot gnu.org
2024-04-03  3:50 ` jvdelisle at gcc dot gnu.org
2024-04-06 13:56 ` cvs-commit at gcc dot gnu.org
2024-04-22  4:23 ` cvs-commit at gcc dot gnu.org
2024-04-22  4:25 ` jvdelisle at gcc dot gnu.org

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-105473-4-gVlZia0gy6@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).