OSDN Git Service

PR libfortran/37839
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 Nov 2008 08:10:41 +0000 (08:10 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 Nov 2008 08:10:41 +0000 (08:10 +0000)
commitb5d015e3eb036000e3aeb3c510b76a7b06cc7b4a
treefd3f39fc5493d036706217573269adc0cd79d272
parentb07ff86b61d685482f617bd89d6bb672aa745962
PR libfortran/37839
* trans-io.c (gfc_build_io_library_fndecls): Decrease pad size back
to 16 pointers plus 32 integers.  Don't use max integer kind
alignment, only gfc_intio_kind's alignment.
(gfc_trans_inquire): Only set flags2 if mask2 is non-zero.
* ioparm.def: Fix order, bitmasks and types of inquire round, sign
and pending fields.  Move u in dt before id.
* io.c (gfc_free_inquire): Free decimal and size exprs.
(match_inquire_element): Match size instead of matching blank twice.
(gfc_resolve_inquire): Resolve size.

* gfortran.dg/f2003_inquire_1.f03: New test.
* gfortran.dg/f2003_io_1.f03: Remove xfail.
* gfortran.dg/f2003_io_4.f03: Likewise.
* gfortran.dg/f2003_io_5.f03: Likewise.
* gfortran.dg/f2003_io_6.f03: Likewise.
* gfortran.dg/f2003_io_7.f03: Likewise.

* io/io.h (IOPARM_INQUIRE_HAS_ROUND, IOPARM_INQUIRE_HAS_SIGN,
IOPARM_INQUIRE_HAS_PENDING): Adjust values.
(st_parameter_inquire): Reorder and fix types of round, sign and
pending fields.
(st_parameter_43, st_parameter_44): Removed.
(st_parameter_dt): Put back struct definition directly to u.p
declaration.  Change type of u.p.size_used from gfc_offset to
GFC_IO_INT.  Decrease back size of u.pad to 16 pointers and
32 ints.  Put id, pos, asynchronous, blank, decimal, delim,
pad, round and sign fields after the union.
* io/inquire.c (inquire_via_unit, inquire_via_filename): Only read
flags2 if it is defined.
* io/transfer.c (read_sf, read_block_form, write_block): Cast
additions to size_used to GFC_IO_INT instead of gfc_offset.
(data_transfer_init): Clear whole u.p struct.  Adjust
for moving id, pos, asynchronous, blank, decimal, delim, pad,
round and sign fields from u.p directly into st_parameter_dt.
(finalize_transfer): Don't cast size_used to GFC_IO_INT.
* io/file_pos.c (st_endfile): Clear whole u.p struct.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142111 138bc75d-0d04-0410-961f-82ee72b054a4
16 files changed:
gcc/fortran/ChangeLog
gcc/fortran/io.c
gcc/fortran/ioparm.def
gcc/fortran/trans-io.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/f2003_inquire_1.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/f2003_io_1.f03
gcc/testsuite/gfortran.dg/f2003_io_4.f03
gcc/testsuite/gfortran.dg/f2003_io_5.f03
gcc/testsuite/gfortran.dg/f2003_io_6.f03
gcc/testsuite/gfortran.dg/f2003_io_7.f03
libgfortran/ChangeLog
libgfortran/io/file_pos.c
libgfortran/io/inquire.c
libgfortran/io/io.h
libgfortran/io/transfer.c