This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] patch PR 15332 colon edit descriptor ignored
- From: François-Xavier Coudert<Francois-Xavier dot Coudert at lcp dot u-psud dot fr>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Mar 2005 01:23:36 +0100
- Subject: [gfortran] patch PR 15332 colon edit descriptor ignored
- Organization: Laboratoire de Chimie Physique
Hi all,
Today's one-line I/O library patch (yes, I'm really specializing in this
business) fixes PR libfortran/15332.
In fact, we simply ignored the colon edit descriptor because we didn't
associate any repeat property to it (f->repeat was -1). With the low
level of debugging available in libgfortran/io routines, it took me two
hours to figure out. So first, independant question: am I welcome to add
some more debugging code (that outputs debugging information) in the CVS
tree, protected by "#if 0 ... #endif" ?
This patch is *strapped and regtested on both mainline and 4.0. OK for
commit?
2005-03-25 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* io/format.c (parse_format_list): format node for colon edit
descriptor needs a repeat counter set to 1.
2005-03-25 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* gfortran.dg/pr15332.f: New test.
Index: libgfortran/io/format.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/format.c,v
retrieving revision 1.9
diff -p -u -r1.9 format.c
--- libgfortran/io/format.c 12 Jan 2005 21:27:30 -0000 1.9
+++ libgfortran/io/format.c 25 Mar 2005 00:04:58 -0000
@@ -564,6 +564,7 @@ parse_format_list (void)
case FMT_COLON:
get_fnode (&head, &tail, FMT_COLON);
+ tail->repeat = 1;
goto optional_comma;
case FMT_SLASH:
! PR libfortran/15332
! {do-do run}
character*12 c
write (c,100) 0, 1
if (c .ne. 'i = 0, j = 1') call abort
write (c,100) 0
if (c .ne. 'i = 0 ') call abort
100 format ('i = ',i1,:,', j = ',i1)
end