public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/33055]  New: ignoring iostat= with -fdefault-integer-8
@ 2007-08-12 14:21 tkoenig at gcc dot gnu dot org
  2007-08-12 19:47 ` [Bug libfortran/33055] " jvdelisle at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-08-12 14:21 UTC (permalink / raw)
  To: gcc-bugs

This is strange.

gfortran.dg/negative_unit.f fails with -fdefault-integer-8.  A
call to generate_error() is issued, which doesn't really make sense:


$ gfortran -fdump-tree-original -fdefault-integer-8 negative_unit.f
$ ./a.out
At line 19 of file negative_unit.f
Fortran runtime error: Negative unit number in I/O statement
$ head -30 negative_unit.f.003t.original 
MAIN__ ()
{
  logical8 l;
  int8 i;
  static int4 options.0[7] = {68, 127, 0, 0, 0, 1, 0};

  _gfortran_set_options (7, (void *) &options.0);
  i = 0;
  {
    int4 iostat.2;
    struct __st_parameter_dt dt_parm.1;

    dt_parm.1.common.filename = &"negative_unit.f"[1]{lb: 1 sz: 1};
    dt_parm.1.common.line = 12;
    iostat.2 = 0;
    dt_parm.1.common.iostat = &iostat.2;
    dt_parm.1.common.flags = 160;
    _gfortran_generate_error (&dt_parm.1, 5005, &"Negative unit number in I/O
statement"[1]{lb: 1 sz: 1});
    dt_parm.1.common.unit = -1;
    _gfortran_st_write (&dt_parm.1);
    _gfortran_transfer_character (&dt_parm.1, &"Hello"[1]{lb: 1 sz: 1}, 5);
    _gfortran_st_write_done (&dt_parm.1);
    i = (int8) iostat.2;
  }
  if (i <= 0)
    {
      _gfortran_abort ();
    }
  i = 0;
  {


-- 
           Summary: ignoring iostat= with -fdefault-integer-8
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
OtherBugsDependingO 32770
             nThis:


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


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

* [Bug libfortran/33055] ignoring iostat= with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
@ 2007-08-12 19:47 ` jvdelisle at gcc dot gnu dot org
  2007-08-14  5:26 ` jvdelisle at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-08-12 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-08-12 19:47 -------
I will give this a shot.


-- 

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-08-12 19:47:16
               date|                            |


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


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

* [Bug libfortran/33055] ignoring iostat= with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
  2007-08-12 19:47 ` [Bug libfortran/33055] " jvdelisle at gcc dot gnu dot org
@ 2007-08-14  5:26 ` jvdelisle at gcc dot gnu dot org
  2007-08-25  4:11 ` [Bug libfortran/33055] Runtime error in INQUIRE unit existance " patchapp at dberlin dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-08-14  5:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2007-08-14 05:25 -------
This makes some sense:  The following reduced case works fine with
-fdefault-integer-8 with iostat given and gives an error without it.  I could
argue that this is OK.  I have not dug into the standard on this, but I will.

      integer i
      logical l
      i = 0
      inquire (unit=-42, exist=l, iostat=i)
      if (l) call abort
      end

If this behavior is too weird, we can disable the check for inquire.  More
later...


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
  2007-08-12 19:47 ` [Bug libfortran/33055] " jvdelisle at gcc dot gnu dot org
  2007-08-14  5:26 ` jvdelisle at gcc dot gnu dot org
@ 2007-08-25  4:11 ` patchapp at dberlin dot org
  2007-08-26 22:05 ` jvdelisle at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: patchapp at dberlin dot org @ 2007-08-25  4:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2007-08-25 04:10 -------
Subject: Bug number PR33055

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01694.html


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-08-25  4:11 ` [Bug libfortran/33055] Runtime error in INQUIRE unit existance " patchapp at dberlin dot org
@ 2007-08-26 22:05 ` jvdelisle at gcc dot gnu dot org
  2007-08-26 22:19 ` jvdelisle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-08-26 22:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2007-08-26 22:05 -------
Subject: Bug 33055

Author: jvdelisle
Date: Sun Aug 26 22:04:48 2007
New Revision: 127817

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

        PR fortran/33055
        * trans-io.c (create_dummy_iostat): New function to create a unique
        dummy variable expression to use with IOSTAT.
        (gfc_trans_inquire): Use the new function to pass unit number error
info
        to run-time library if a regular IOSTAT variable was not given.

        PR libfortran/33055
        * io/inquire.c (inquire_via_unit):  If inquiring by unit, check for 
        an error condition from the IOSTAT variable and set EXIST to false if
        there was a bad unit number.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-io.c
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/inquire.c


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-08-26 22:05 ` jvdelisle at gcc dot gnu dot org
@ 2007-08-26 22:19 ` jvdelisle at gcc dot gnu dot org
  2007-08-26 22:24 ` jvdelisle at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-08-26 22:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2007-08-26 22:19 -------
Subject: Bug 33055

Author: jvdelisle
Date: Sun Aug 26 22:19:18 2007
New Revision: 127819

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

        PR fortran/33055
        * gfortran.dg/negative_unit.f: Add new check
        * gfortran.dg/negative_unit_int8.f: New. Same as above except use
        -fdefault-integer-8.

Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-08-26 22:19 ` jvdelisle at gcc dot gnu dot org
@ 2007-08-26 22:24 ` jvdelisle at gcc dot gnu dot org
  2007-08-29  2:26 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-08-26 22:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2007-08-26 22:24 -------
Fixed on trunk.


-- 

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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-08-26 22:24 ` jvdelisle at gcc dot gnu dot org
@ 2007-08-29  2:26 ` jvdelisle at gcc dot gnu dot org
  2007-08-29 19:02 ` tkoenig at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-08-29  2:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2007-08-29 02:26 -------
Subject: Bug 33055

Author: jvdelisle
Date: Wed Aug 29 02:26:01 2007
New Revision: 127877

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

        PR fortran/33055
        Revert previous patch.

Removed:
    trunk/gcc/testsuite/gfortran.dg/negative_unit_int8.f
Modified:
    trunk/gcc/fortran/trans-io.c
    trunk/gcc/testsuite/gfortran.dg/negative_unit.f
    trunk/libgfortran/io/inquire.c


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-08-29  2:26 ` jvdelisle at gcc dot gnu dot org
@ 2007-08-29 19:02 ` tkoenig at gcc dot gnu dot org
  2007-08-30  5:01 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-08-29 19:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tkoenig at gcc dot gnu dot org  2007-08-29 19:02 -------
Hi Jerry,

what was the problem?


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-08-29 19:02 ` tkoenig at gcc dot gnu dot org
@ 2007-08-30  5:01 ` jvdelisle at gcc dot gnu dot org
  2007-10-06 15:11 ` patchapp at dberlin dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-08-30  5:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2007-08-30 05:01 -------
The following ICEs the the above patches which I reverted until I sort this
out.

MODULE print_it
CONTAINS
  SUBROUTINE i()
    LOGICAL :: qexist
    INQUIRE (UNIT=1, EXIST=qexist)
  END SUBROUTINE i
END MODULE print_it

Was PR33217, re-opening this PR


-- 

jvdelisle at gcc dot gnu dot org changed:

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


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-08-30  5:01 ` jvdelisle at gcc dot gnu dot org
@ 2007-10-06 15:11 ` patchapp at dberlin dot org
  2007-10-15 13:56 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: patchapp at dberlin dot org @ 2007-10-06 15:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from patchapp at dberlin dot org  2007-10-06 15:11 -------
Subject: Bug number PR33055

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00081.html


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-10-06 15:11 ` patchapp at dberlin dot org
@ 2007-10-15 13:56 ` jvdelisle at gcc dot gnu dot org
  2007-10-15 13:59 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-10-15 13:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2007-10-15 13:56 -------
Subject: Bug 33055

Author: jvdelisle
Date: Mon Oct 15 13:55:47 2007
New Revision: 129328

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

        PR fortran/33055
        * trans-io.c (create_dummy_iostat): New function to create a unique
        dummy variable expression to use with IOSTAT.
        (gfc_trans_inquire): Use the new function to pass unit number error
info
        to run-time library if a regular IOSTAT variable was not given.

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


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2007-10-15 13:56 ` jvdelisle at gcc dot gnu dot org
@ 2007-10-15 13:59 ` jvdelisle at gcc dot gnu dot org
  2007-10-15 14:05 ` jvdelisle at gcc dot gnu dot org
  2007-10-15 14:05 ` jvdelisle at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-10-15 13:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jvdelisle at gcc dot gnu dot org  2007-10-15 13:59 -------
Subject: Bug 33055

Author: jvdelisle
Date: Mon Oct 15 13:59:02 2007
New Revision: 129344

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

        PR libfortran/33055
        * io/inquire.c (inquire_via_unit):  If inquiring by unit, check for
        an error condition from the IOSTAT variable and set EXIST to false if
        there was a bad unit number.

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


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2007-10-15 13:59 ` jvdelisle at gcc dot gnu dot org
@ 2007-10-15 14:05 ` jvdelisle at gcc dot gnu dot org
  2007-10-15 14:05 ` jvdelisle at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-10-15 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jvdelisle at gcc dot gnu dot org  2007-10-15 14:04 -------
Subject: Bug 33055

Author: jvdelisle
Date: Mon Oct 15 14:03:52 2007
New Revision: 129346

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

        PR libfortran/33055
        * gfortran.dg/inquire_11.f90: New test.
        * gfortan.dg/negative_unit_int8.f: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/inquire_11.f90
    trunk/gcc/testsuite/gfortran.dg/negative_unit_int8.f
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug libfortran/33055] Runtime error in INQUIRE unit existance with -fdefault-integer-8
  2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2007-10-15 14:05 ` jvdelisle at gcc dot gnu dot org
@ 2007-10-15 14:05 ` jvdelisle at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-10-15 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jvdelisle at gcc dot gnu dot org  2007-10-15 14:05 -------
Fixed.


-- 

jvdelisle at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-10-15 14:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-12 14:21 [Bug libfortran/33055] New: ignoring iostat= with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
2007-08-12 19:47 ` [Bug libfortran/33055] " jvdelisle at gcc dot gnu dot org
2007-08-14  5:26 ` jvdelisle at gcc dot gnu dot org
2007-08-25  4:11 ` [Bug libfortran/33055] Runtime error in INQUIRE unit existance " patchapp at dberlin dot org
2007-08-26 22:05 ` jvdelisle at gcc dot gnu dot org
2007-08-26 22:19 ` jvdelisle at gcc dot gnu dot org
2007-08-26 22:24 ` jvdelisle at gcc dot gnu dot org
2007-08-29  2:26 ` jvdelisle at gcc dot gnu dot org
2007-08-29 19:02 ` tkoenig at gcc dot gnu dot org
2007-08-30  5:01 ` jvdelisle at gcc dot gnu dot org
2007-10-06 15:11 ` patchapp at dberlin dot org
2007-10-15 13:56 ` jvdelisle at gcc dot gnu dot org
2007-10-15 13:59 ` jvdelisle at gcc dot gnu dot org
2007-10-15 14:05 ` jvdelisle at gcc dot gnu dot org
2007-10-15 14:05 ` 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).