This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, libfortran][Regression] PR43265 No EOF condition if reading with '(x)' from an empty file


On Mon, Mar 8, 2010 at 6:33 AM, Jerry DeLisle <jvdelisle@verizon.net> wrote:
> Hi,
>
> The attached patch fixes this PR by extracting the code in read_sf used by
> read_x and putting it into read_x. ?This re-factoring includes getting rid
> of the no_error parameter from read_sf and trimming down the code to a
> minimum needed by read_x. Handling of EOF and EOR conditions within read_x
> are now tailored for read_x. ?This adds a check of the item count so that
> trailing X format specifiers will not produce an EOF, but leading X format
> specifiers will.
>
> The two test cases given test these conditions.
>
> I also deleted an incorrect use of hit_eof found in read_sf. This eliminated
> a
> wrong code found when the format is modified from
> (1x,a3,1x,a3,1x,a3,1x,a3,10x)
> to (1x,a3,1x,a3,1x,a3,1x,a3) in read_x_past.f, updated to test this.
>
> Regression tested and NIST tested on x86-64. ?OK for trunk.

This caused

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43320

SPEC CPU 2000 200.sixtrack now fails.

Richard.

> Regards,
>
> Jerry
>
> 2010-03-07 ?Jerry DeLisle ?<jvdelisle@gcc.gnu.org>
>
> ? ?PR libfortran/43265
> ? ?* io/read.c: Include fbuf.h and unix.h to enable lower level I/O for
> ? ?read_x. (read_x): Replace the use of read_sf with equivalent lower level
> ? ?I/O, eliminating unneeded code and handling EOF and EOR conditions.
> ? ?* io/io.h: Revise prototype for read_sf.
> ? ?* io/transfer.c (read_sf): Delete no_error parameter and all uses of it.
> ? ?(read_block_form): Likewise.
> ? ?(next_record_r): Delete wrong code call to hit_eof.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]