[patch, libgfortran] PR43265 Additional Regression

Paul Richard Thomas paul.richard.thomas@gmail.com
Tue Mar 30 05:04:00 GMT 2010


Dear Jerry,

This seems from my vantage point to be a bit of a white knuckle ride!
I hope that it is now done  :-)  What seems incredible to me is that
the testsuite has so many wierd and wonderful corner cases and yet new
buglets keep appearing.

OK for trunk and 4.4

Thanks

Paul

On Tue, Mar 30, 2010 at 5:18 AM, Jerry DeLisle <jvdelisle@verizon.net> wrote:
> I re-opened this PR after Jean-Baptiste sent me a test case to illustrate
> the problem.  I took this test case and then modified it to be suitable for
> our test suite.  Thanks to JBF for the report.
>
> The patch is relatively simple.  The previous logic was left over from my
> debugging sessions on this series of EOF related bugs and really was
> incorrect.
>
> Regression tested on x86-64-linux-gnu.  I plan to commit shortly and back
> port to 4.4 shortly.
>
> Regards,
>
> Jerry
>
> 2010-03-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
>
>        PR libfortran/43265
>
>        * io/transfer.c (next_record_r): Only call hit_eof for specific
>        conditions when an EOF is encountered.
>
>
> Index: transfer.c
> ===================================================================
> --- transfer.c  (revision 157809)
> +++ transfer.c  (working copy)
> @@ -2848,9 +2848,14 @@ next_record_r (st_parameter_dt *dtp, int done)
>                {
>                   if (errno != 0)
>                     generate_error (&dtp->common, LIBERROR_OS, NULL);
> -                 else if (dtp->u.p.item_count == 1
> -                          || dtp->u.p.pending_spaces == 0)
> -                   hit_eof (dtp);
> +                 else
> +                   {
> +                     if (is_stream_io (dtp)
> +                         || dtp->u.p.current_unit->pad_status == PAD_NO
> +                         || dtp->u.p.current_unit->bytes_left
> +                            == dtp->u.p.current_unit->recl)
> +                       hit_eof (dtp);
> +                   }
>                  break;
>                 }
>
>



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy



More information about the Fortran mailing list