This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] PATCH fix PR libfortran/20257
- From: FranÃois-Xavier Coudert <Francois-Xavier dot Coudert at lcp dot u-psud dot fr>
- To: gfortran <fortran at gcc dot gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 03 Mar 2005 11:26:29 +0100
- Subject: [gfortran] PATCH fix PR libfortran/20257
- Organization: Laboratoire de Chimie Physique
Hi all,
This trivial one-line fix (hereby donated to the FSF) partially fixes PR
20257 (we can't output large arrays) when writing to files. The problem
still isn't fixed when we write to preconnected units (stdout, stdin), since
it requires more thinking about what the Right Thing is in that latter case.
These two problems are orthogonal, so this patch should go anyway.
*strapped and regtested on i686-linux. OK for mainline and 4.0? If so,
please commit (I don't have CVS write access).
2005-03-03 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20257
* open.c (new_unit): set record length to max_offset rather than
using a hard-coded limit (which was too low).
2005-03-03 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20257
* write_big_array.f90: New test.
Index: libgfortran/io/open.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/open.c,v
retrieving revision 1.10
diff -p -u -r1.10 open.c
--- libgfortran/io/open.c 23 Jan 2005 00:14:30 -0000 1.10
+++ libgfortran/io/open.c 3 Mar 2005 10:10:51 -0000
@@ -358,7 +358,7 @@ new_unit (unit_flags * flags)
/* Unspecified recl ends up with a processor dependent value. */
- u->recl = (ioparm.recl_in != 0) ? ioparm.recl_in : DEFAULT_RECL;
+ u->recl = (ioparm.recl_in != 0) ? ioparm.recl_in : g.max_offset;
u->last_record = 0;
u->current_record = 0;
! { dg-do run }
integer,parameter :: n = 10000
real(8) array(10000)
array(:) = 0
open (10, status='scratch')
write (10,*) array
close (10)
end