This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, libgfortran] PR43265 Follow-up 1
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: gfortran <fortran at gcc dot gnu dot org>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Mar 2010 09:08:57 -0800
- Subject: [patch, libgfortran] PR43265 Follow-up 1
Greetings,
This patch allows the test case to run as discussed in the PR.
Regression tested on x86-64. OK for trunk?
Jerry
2010-03-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/43265
* io/transfer.c (read_block_form): Return empty string for internal
unit.
Index: transfer.c
===================================================================
--- transfer.c (revision 157393)
+++ transfer.c (working copy)
@@ -338,6 +338,7 @@ read_sf (st_parameter_dt *dtp, int * length)
void *
read_block_form (st_parameter_dt *dtp, int * nbytes)
{
+ static char *empty_string[0];
char *source;
int norig;
@@ -362,7 +363,9 @@ read_block_form (st_parameter_dt *dtp, int * nbyte
if (unlikely (dtp->u.p.current_unit->bytes_left == 0))
{
- hit_eof (dtp);
+ if (is_internal_unit (dtp) && dtp->internal_unit_len == 0)
+ return empty_string;
+ hit_eof (dtp);
return NULL;
}
! { dg-do run }
! PR43265 Follow-up, read from empty string.
character(len=2) str
str = ''
read(str(1:0), '(T7,i1)') i
if (i /= 0) call abort
end