[patch, libgfortran] PR31052 Bad IOSTAT values when readings NAMELISTs past EOF

Jerry DeLisle jvdelisle@verizon.net
Sat Mar 31 11:22:00 GMT 2007


Jerry DeLisle wrote:
:REVIEWMAIL:
> 
> Here is a final installment with test case.  I eliminated the 
> test_endfile function.  Then I added a new function is_special () that 
> returns true if the special file bit is set in the stream structure.
> 
The attached patch is identical to my first patch that fixed this bug but failed 
sixtrack in SPEC with the exception of the last hunk.

The last hunk adds the test for end file to st_read where it belongs.

Regression tested on x86-64 and SPEC tested by Seongbae Park.

Also tested with Harald Anlauf's new test case, modified and attached as well.

I want to especially thank Seongbae and Harald for their assistance testing and 
finding the test cases.

I hope this settles it with this bug. (humbly)

OK for Trunk?

Regards,

Jerry

2007-03-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

     PR libgfortran/31052
     * io/file_position (st_rewind): Remove use of
     test_endfile. Don't seek if already at 0 position.  Use new is_special
     function to set endfile state.
     * io/open.c (test_endfile): Delete this function.
     (edit_modes): Delete call to test_endfile.
     (new_unit): Likewise.
     * io/io.h: Delete prototype for test_endfile.  Add prototype
     for is_special.
     * io/transfer.c (next_record_r): Remove use of test_endfile.
     (st_read):  Add test for end file condition and adjust status.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sixtrack-2.diff
Type: text/x-patch
Size: 2759 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070331/4c591be4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: namelist_28.f90
Type: text/x-fortran
Size: 2359 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070331/4c591be4/attachment-0001.bin>


More information about the Gcc-patches mailing list