public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/21647] New: INQUIRE errors when using -fdefault-integer-8
@ 2005-05-18 15:58 dir at lanl dot gov
2005-05-19 16:52 ` [Bug libfortran/21647] " tobi at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: dir at lanl dot gov @ 2005-05-18 15:58 UTC (permalink / raw)
To: gcc-bugs
When compilied with "-fdefault-integer-8", inquire incorrectly says that a file
exits. It works correctly without the "-fdefault-integer-8"
[dranta:~/tests/gfortran] dir% gfortran -fdefault-integer-8 -o d8test4 d8test4.f
[dranta:~/tests/gfortran] dir% d8test4
output exists
STOP 0
[dranta:~/tests/gfortran] dir% gfortran -o d8test4 d8test4.f
[dranta:~/tests/gfortran] dir% d8test4
output Does not exist
STOP 0
[dranta:~/tests/gfortran] dir% cat d8test4.f
program test2
character*8 nfn
LOGICAL EX
nfn='output'
INQUIRE (FILE=nfn,EXIST=EX)
IF (EX) THEN
WRITE(*,*)nfn, ' exists'
ELSE
WRITE(*,*)nfn,' Does not exist'
END IF
stop
end
[dranta:~/tests/gfortran] dir% ls o*
tcsh: ls: No match.
--
Summary: INQUIRE errors when using -fdefault-integer-8
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dir at lanl dot gov
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin7.9.0
GCC host triplet: powerpc-apple-darwin7.9.0
GCC target triplet: powerpc-apple-darwin7.9.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21647
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libfortran/21647] INQUIRE errors when using -fdefault-integer-8
2005-05-18 15:58 [Bug libfortran/21647] New: INQUIRE errors when using -fdefault-integer-8 dir at lanl dot gov
@ 2005-05-19 16:52 ` tobi at gcc dot gnu dot org
2005-05-19 16:52 ` tobi at gcc dot gnu dot org
2005-09-11 21:27 ` [Bug fortran/21647] " fxcoudert at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-05-19 16:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2005-05-19 16:51 -------
Confirmed. The problem is that the default LOGICAL ex gets promoted to
LOGICAL*8, but we pass (int4_t *)&ex to the library, which can't work.
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-05-19 16:51:13 |2005-05-19 16:51:29
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21647
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libfortran/21647] INQUIRE errors when using -fdefault-integer-8
2005-05-18 15:58 [Bug libfortran/21647] New: INQUIRE errors when using -fdefault-integer-8 dir at lanl dot gov
2005-05-19 16:52 ` [Bug libfortran/21647] " tobi at gcc dot gnu dot org
@ 2005-05-19 16:52 ` tobi at gcc dot gnu dot org
2005-09-11 21:27 ` [Bug fortran/21647] " fxcoudert at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-05-19 16:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2005-05-19 16:51 -------
Confirmed. The problem is that the default LOGICAL ex gets promoted to
LOGICAL*8, but we pass a (int4_t *)&ex to the library, which can't work.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-05-19 16:51:13
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21647
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/21647] INQUIRE errors when using -fdefault-integer-8
2005-05-18 15:58 [Bug libfortran/21647] New: INQUIRE errors when using -fdefault-integer-8 dir at lanl dot gov
2005-05-19 16:52 ` [Bug libfortran/21647] " tobi at gcc dot gnu dot org
2005-05-19 16:52 ` tobi at gcc dot gnu dot org
@ 2005-09-11 21:27 ` fxcoudert at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-09-11 21:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-09-11 21:27 -------
This is a front-end bug. We generate wrong code for all the ioparm members that
are passed by reference (the pointers are cast, instead of creating
temporaries). All cases handled by set_parameter_ref (in trans-io.c) are handled
incorrectly when given a kind different that the GFC_INTEGER_4. Exhaustive list
(hopefully) is: iostat, exist, opened, number, named, recl, nextrec, size and
iolength. Two examples:
$ cat a.f90
logical*8 ex
inquire (file="foo",exist=ex)
end
$ gfortran -fdump-tree-original a.f90
$ cat a.f90.t02.original
MAIN__ ()
{
logical8 ex;
_gfortran_filename = "a.f90";
_gfortran_line = 2;
_gfortran_ioparm.file = "foo";
_gfortran_ioparm.file_len = 3;
_gfortran_ioparm.exist = (int4 *) &ex;
_gfortran_st_inquire ();
}
$ cat b.f90
integer*8 i
write(*,"()",iostat=i)
end
$ gfortran -fdump-tree-original b.f90
$ cat b.f90.t02.original
MAIN__ ()
{
int8 i;
_gfortran_filename = "b.f90";
_gfortran_line = 2;
_gfortran_ioparm.unit = 6;
_gfortran_ioparm.format = "()";
_gfortran_ioparm.format_len = 2;
_gfortran_ioparm.iostat = (int4 *) &i;
_gfortran_st_write ();
_gfortran_st_write_done ();
}
My guess is that in both cases, we should create a temporary before the call,
set the ioparm member to that temporary, make the library call and then get the
value from the temporary back to the real variable. Unfortunately, I have no
idea how to do that (i'm not much of a front-end guy).
--
What |Removed |Added
----------------------------------------------------------------------------
Component|libfortran |fortran
Keywords| |wrong-code
Last reconfirmed|2005-05-19 16:51:29 |2005-09-11 21:27:46
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21647
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-09-11 21:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18 15:58 [Bug libfortran/21647] New: INQUIRE errors when using -fdefault-integer-8 dir at lanl dot gov
2005-05-19 16:52 ` [Bug libfortran/21647] " tobi at gcc dot gnu dot org
2005-05-19 16:52 ` tobi at gcc dot gnu dot org
2005-09-11 21:27 ` [Bug fortran/21647] " 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).