[patch, libfortran][Regression] PR43265 No EOF condition if reading with '(x)' from an empty file
Richard Guenther
richard.guenther@gmail.com
Wed Mar 10 12:50:00 GMT 2010
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.
>
More information about the Gcc-patches
mailing list