public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS
@ 2005-03-27 21:53 kargl at gcc dot gnu dot org
2005-03-27 21:56 ` [Bug fortran/20660] " kargl at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 11+ messages in thread
From: kargl at gcc dot gnu dot org @ 2005-03-27 21:53 UTC (permalink / raw)
To: gcc-bugs
This is Walt Brainerd's fc001.f95
INQUIRE says only units 5, 6 exist,
but open(11... works. This is wrong.
Units 5 and 6 are preconnected, which
means that they are open, but all
units that can be used should exist.
--
Summary: INQUIRE incorrectly reports the existence of UNITS
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kargl at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
@ 2005-03-27 21:56 ` kargl at gcc dot gnu dot org
2005-03-27 21:59 ` [Bug libfortran/20660] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu dot org @ 2005-03-27 21:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kargl at gcc dot gnu dot org 2005-03-27 21:56 -------
Created an attachment (id=8463)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8463&action=view)
Walt's program
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
2005-03-27 21:56 ` [Bug fortran/20660] " kargl at gcc dot gnu dot org
@ 2005-03-27 21:59 ` pinskia at gcc dot gnu dot org
2005-03-29 7:13 ` fxcoudert at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-27 21:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-27 21:59 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|fortran |libfortran
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-03-27 21:59:44
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
2005-03-27 21:56 ` [Bug fortran/20660] " kargl at gcc dot gnu dot org
2005-03-27 21:59 ` [Bug libfortran/20660] " pinskia at gcc dot gnu dot org
@ 2005-03-29 7:13 ` fxcoudert at gcc dot gnu dot org
2005-03-29 7:24 ` Andrew Pinski
2005-03-29 7:24 ` pinskia at physics dot uc dot edu
` (5 subsequent siblings)
8 siblings, 1 reply; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-03-29 7:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-03-29 07:12 -------
I don't have time to test it and submit it correctly, but I think the following
should work. I someone has time to do it before I do, please feel free to
test/comment/apply.
Index: inquire.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/inquire.c,v
retrieving revision 1.9
diff -p -u -r1.9 inquire.c
--- inquire.c 30 Jan 2005 13:16:19 -0000 1.9
+++ inquire.c 29 Mar 2005 07:10:57 -0000
@@ -46,7 +46,7 @@ inquire_via_unit (gfc_unit * u)
const char *p;
if (ioparm.exist != NULL)
- *ioparm.exist = (u != NULL);
+ *ioparm.exist = (u != NULL ? 1 : 0);
if (ioparm.opened != NULL)
*ioparm.opened = (u != NULL);
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Keywords| |patch
Last reconfirmed|2005-03-27 21:59:44 |2005-03-29 07:12:59
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-29 7:13 ` fxcoudert at gcc dot gnu dot org
@ 2005-03-29 7:24 ` Andrew Pinski
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Pinski @ 2005-03-29 7:24 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
On Mar 29, 2005, at 2:13 AM, fxcoudert at gcc dot gnu dot org wrote:
> - *ioparm.exist = (u != NULL);
> + *ioparm.exist = (u != NULL ? 1 : 0);
This change does nothing.
-- Pinski
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-03-29 7:13 ` fxcoudert at gcc dot gnu dot org
@ 2005-03-29 7:24 ` pinskia at physics dot uc dot edu
2005-03-29 9:01 ` fxcoudert at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: pinskia at physics dot uc dot edu @ 2005-03-29 7:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at physics dot uc dot edu 2005-03-29 07:24 -------
Subject: Re: INQUIRE incorrectly reports the existence of UNITS
On Mar 29, 2005, at 2:13 AM, fxcoudert at gcc dot gnu dot org wrote:
> - *ioparm.exist = (u != NULL);
> + *ioparm.exist = (u != NULL ? 1 : 0);
This change does nothing.
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-03-29 7:24 ` pinskia at physics dot uc dot edu
@ 2005-03-29 9:01 ` fxcoudert at gcc dot gnu dot org
2005-03-29 10:52 ` fxcoudert at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-03-29 9:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-03-29 09:01 -------
Stupid of me, sorry the noise. If I understand correctly the Standard, INQUIRE
on the existence of a unit should always return TRUE (since we can always open a
unit). The patch may be (testing in progress) as simple as:
Index: inquire.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/inquire.c,v
retrieving revision 1.9
diff -p -u -r1.9 inquire.c
--- inquire.c 30 Jan 2005 13:16:19 -0000 1.9
+++ inquire.c 29 Mar 2005 07:10:57 -0000
@@ -46,7 +46,7 @@ inquire_via_unit (gfc_unit * u)
const char *p;
if (ioparm.exist != NULL)
- *ioparm.exist = (u != NULL);
+ *ioparm.exist = 1;
if (ioparm.opened != NULL)
*ioparm.opened = (u != NULL);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-03-29 9:01 ` fxcoudert at gcc dot gnu dot org
@ 2005-03-29 10:52 ` fxcoudert at gcc dot gnu dot org
2005-03-31 15:30 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-03-29 10:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-03-29 10:52 -------
After testing, I proposed this same patch on the mailing-list:
http://gcc.gnu.org/ml/fortran/2005-03/msg00519.html
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-03-29 07:12:59 |2005-03-29 10:52:07
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-03-29 10:52 ` fxcoudert at gcc dot gnu dot org
@ 2005-03-31 15:30 ` cvs-commit at gcc dot gnu dot org
2005-03-31 15:37 ` cvs-commit at gcc dot gnu dot org
2005-03-31 16:27 ` fxcoudert at gcc dot gnu dot org
8 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-31 15:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-31 15:30 -------
Subject: Bug 20660
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: fxcoudert@gcc.gnu.org 2005-03-31 15:30:06
Modified files:
gcc/testsuite : ChangeLog
libgfortran : ChangeLog
libgfortran/io : inquire.c transfer.c
Added files:
gcc/testsuite/gfortran.dg: negative_unit.f
Log message:
PR libfortran/20660
* io/inquire.c (inquire_via_unit): Non-opened units should still be
reported by an INQUIRE statement as existing.
* io/transfer.c (data_transfer_init): Never accept negative units.
PR libfortran/20660
* gfortran.dg/negative_unit.f: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5243&r2=1.5244
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/negative_unit.f.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.179&r2=1.180
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/inquire.c.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&r1=1.33&r2=1.34
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-03-31 15:30 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-31 15:37 ` cvs-commit at gcc dot gnu dot org
2005-03-31 16:27 ` fxcoudert at gcc dot gnu dot org
8 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-31 15:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-31 15:36 -------
Subject: Bug 20660
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: fxcoudert@gcc.gnu.org 2005-03-31 15:36:11
Modified files:
gcc/testsuite : ChangeLog
libgfortran : ChangeLog
libgfortran/io : inquire.c transfer.c
Added files:
gcc/testsuite/gfortran.dg: negative_unit.f
Log message:
PR libfortran/20660
* io/inquire.c (inquire_via_unit): Non-opened units should still be
reported by an INQUIRE statement as existing.
* io/transfer.c (data_transfer_init): Never accept negative units.
PR libfortran/20660
* gfortran.dg/negative_unit.f: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.82&r2=1.5084.2.83
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/negative_unit.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.163.2.12&r2=1.163.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/inquire.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.9&r2=1.9.8.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.32.2.1&r2=1.32.2.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/20660] INQUIRE incorrectly reports the existence of UNITS
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-03-31 15:37 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-31 16:27 ` fxcoudert at gcc dot gnu dot org
8 siblings, 0 replies; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-03-31 16:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-03-31 16:27 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20660
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-03-31 16:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-27 21:53 [Bug fortran/20660] New: INQUIRE incorrectly reports the existence of UNITS kargl at gcc dot gnu dot org
2005-03-27 21:56 ` [Bug fortran/20660] " kargl at gcc dot gnu dot org
2005-03-27 21:59 ` [Bug libfortran/20660] " pinskia at gcc dot gnu dot org
2005-03-29 7:13 ` fxcoudert at gcc dot gnu dot org
2005-03-29 7:24 ` Andrew Pinski
2005-03-29 7:24 ` pinskia at physics dot uc dot edu
2005-03-29 9:01 ` fxcoudert at gcc dot gnu dot org
2005-03-29 10:52 ` fxcoudert at gcc dot gnu dot org
2005-03-31 15:30 ` cvs-commit at gcc dot gnu dot org
2005-03-31 15:37 ` cvs-commit at gcc dot gnu dot org
2005-03-31 16:27 ` fxcoudert 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).