From 831cf09d60eed9f14cb06e83831cf74ea328a3bf Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Sat, 18 Nov 2017 18:13:20 +0200 Subject: [PATCH] PR 44292 Enable large record lengths in OPEN and INQUIRE statements This is a straightforward change that we can do now that the ABI has been bumped (again!). Regtested on x86_64-pc-linux-gnu. gcc/fortran/ChangeLog: 2017-11-18 Janne Blomqvist PR fortran/44292 * ioparm.def (IOPARM): Make recl_in intio, and recl_out pintio. libgfortran/ChangeLog: 2017-11-18 Janne Blomqvist PR fortran/44292 * io/io.h: Make recl_in a GC_IO_INT and recl_out a type GFC_IO_INT*. gcc/testsuite/ChangeLog: 2017-11-18 Janne Blomqvist PR fortran/44292 * gfortran.dg/large_recl.f90: New test. From-SVN: r254915 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/ioparm.def | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/large_recl.f90 | 12 ++++++++++++ libgfortran/ChangeLog | 8 +++++++- libgfortran/io/io.h | 6 +++--- 6 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/large_recl.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8be551822b1..43349019b6f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2017-11-18 Janne Blomqvist + + PR fortran/44292 + * ioparm.def (IOPARM): Make recl_in intio, and recl_out pintio. + 2017-11-18 Thomas Koenig PR fortran/83012 diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def index ca5631b9cd9..5fc04bc9019 100644 --- a/gcc/fortran/ioparm.def +++ b/gcc/fortran/ioparm.def @@ -34,7 +34,7 @@ IOPARM (common, line, 0, int4) IOPARM (common, iomsg, 1 << 6, char2) IOPARM (common, iostat, 1 << 5, pint4) IOPARM (open, common, 0, common) -IOPARM (open, recl_in, 1 << 7, int4) +IOPARM (open, recl_in, 1 << 7, intio) IOPARM (open, file, 1 << 8, char2) IOPARM (open, status, 1 << 9, char1) IOPARM (open, access, 1 << 10, char2) @@ -63,7 +63,7 @@ IOPARM (inquire, opened, 1 << 8, pint4) IOPARM (inquire, number, 1 << 9, pint4) IOPARM (inquire, named, 1 << 10, pint4) IOPARM (inquire, nextrec, 1 << 11, pint4) -IOPARM (inquire, recl_out, 1 << 12, pint4) +IOPARM (inquire, recl_out, 1 << 12, pintio) IOPARM (inquire, strm_pos_out, 1 << 13, pintio) IOPARM (inquire, file, 1 << 14, char1) IOPARM (inquire, access, 1 << 15, char2) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dabd308f88a..25cb660fb38 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-18 Janne Blomqvist + + PR fortran/44292 + * gfortran.dg/large_recl.f90: New test. + 2017-11-18 Thomas Koenig PR fortran/83012 diff --git a/gcc/testsuite/gfortran.dg/large_recl.f90 b/gcc/testsuite/gfortran.dg/large_recl.f90 new file mode 100644 index 00000000000..97ac63f7e4d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/large_recl.f90 @@ -0,0 +1,12 @@ +! { dg-do run } +! PR 44292 Large RECL= +program large_recl + implicit none + integer(kind=8) :: r + open(10, status="scratch", recl=12345678901_8, form="unformatted", access="direct") + inquire(10, recl=r) + close(10, status="delete") + if (r /= 12345678901_8) then + call abort() + end if +end program large_recl diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index a486eed8a2c..fa5646ba94f 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2017-11-18 Janne Blomqvist + + PR fortran/44292 + * io/io.h: Make recl_in a GC_IO_INT and recl_out a type + GFC_IO_INT*. + 2017-11-17 Igor Tsimbalist * acinclude.m4: Add enable.m4, cet.m4. @@ -12,7 +18,7 @@ PR libgfortran/81938 io/format.c (free_format_data): Don't try to free vlist descriptors past the end of the fnode array. - + 2017-10-10 Thomas Koenig PR libfortran/82233 diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index df491577349..3330bcee625 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -308,7 +308,7 @@ unit_sign_s; typedef struct { st_parameter_common common; - GFC_INTEGER_4 recl_in; + GFC_IO_INT recl_in; CHARACTER2 (file); CHARACTER1 (status); CHARACTER2 (access); @@ -388,8 +388,8 @@ typedef struct { st_parameter_common common; GFC_INTEGER_4 *exist, *opened, *number, *named; - GFC_INTEGER_4 *nextrec, *recl_out; - GFC_IO_INT *strm_pos_out; + GFC_INTEGER_4 *nextrec; + GFC_IO_INT *recl_out, *strm_pos_out; CHARACTER1 (file); CHARACTER2 (access); CHARACTER1 (form); -- 2.30.2