This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch,libfortran] [4.4 Regression] PR38430 gfortran.dg/streamio_1.f90, 10, 14, 2, 6 now fails
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 08 Dec 2008 19:17:23 -0800
- Subject: [patch,libfortran] [4.4 Regression] PR38430 gfortran.dg/streamio_1.f90, 10, 14, 2, 6 now fails
This patch fixes the regression on CRIS/ELF. It was really broken on all
platforms but did not show up in testsuite. The error was caused by using
dtp->rec instead of dtp->pos while checking that the position did not exceed the
maximum value allowed.
I also commented out a constraint that would cause 4.3 executables to fail with
4.4 library. This code will be uncommented later when we have to break ABI for
other reasons. The effect of not having the check is to accept REC= with STREAM
access. The value passed to REC= will be treated as if it is POS=.
I will commit for now and if anyone objects to this solution I can simply
un-comment it.
Regression tested on x86-64.
Regards,
Jerry
2008-12-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/38430
* io/transfer.c (data_transfer_init): Move constraint check for REC=
and STREAM access into condition for other REC= constraints to simplify.
Comment out this constraint to avoid breaking compatibility with 4.3
until later. Added a TODO for above comment and this one.
Fix test for max pos.
Index: transfer.c
===================================================================
--- transfer.c (revision 142574)
+++ transfer.c (working copy)
@@ -1986,15 +1986,6 @@ data_transfer_init (st_parameter_dt *dtp
return;
}
- if (dtp->u.p.current_unit->flags.access == ACCESS_STREAM
- && (cf & IOPARM_DT_HAS_REC) != 0)
- {
- generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
- "Record number not allowed for stream access "
- "data transfer");
- return;
- }
-
/* Process the ADVANCE option. */
dtp->u.p.advance_status
@@ -2141,7 +2132,7 @@ data_transfer_init (st_parameter_dt *dtp
return;
}
- if (dtp->rec >= dtp->u.p.current_unit->maxrec)
+ if (dtp->pos >= dtp->u.p.current_unit->maxrec)
{
generate_error (&dtp->common, LIBERROR_BAD_OPTION,
"POS=specifier too large");
@@ -2231,10 +2222,20 @@ data_transfer_init (st_parameter_dt *dtp
return;
}
- /* This is required to maintain compatibility between
- 4.3 and 4.4 runtime. */
+ /* TODO: This is required to maintain compatibility between
+ 4.3 and 4.4 runtime. Remove when ABI changes from 4.3 */
+
if (is_stream_io (dtp))
dtp->u.p.current_unit->strm_pos = dtp->rec;
+
+ /* TODO: Un-comment this code when ABI changes from 4.3.
+ if (dtp->u.p.current_unit->flags.access == ACCESS_STREAM)
+ {
+ generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+ "Record number not allowed for stream access "
+ "data transfer");
+ return;
+ } */
}