]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/16436 (gfortran TL edit descriptor failure - test f77-edit-t-in.f)
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Thu, 16 Jun 2005 22:25:41 +0000 (00:25 +0200)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 16 Jun 2005 22:25:41 +0000 (22:25 +0000)
PR libfortran/16436
* io/transfer.c (read_sf): Correct updating of bytes_left field.
(formatted_transfer): Correct updating of bytes_left field and
reformatting code (comments and whitespace).
* io/unix.c (move_pos_offset): "active" field should not be
changed here. Whitespace corrections.
* gfortran.dg/g77/f77-edit-t-in.f: Not XFAIL-ed any more.

From-SVN: r101101

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/g77/f77-edit-t-in.f
libgfortran/ChangeLog
libgfortran/io/transfer.c
libgfortran/io/unix.c

index 27378a1d8132af4df990eb84ba863ce6252a03b5..1782c6e85d8daafa62962934c26b04c465482dfd 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/16436
+       * gfortran.dg/g77/f77-edit-t-in.f: Not XFAIL-ed any more.
+
 2005-06-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/22043
index 6abd1967b897db06021aa51080fbc21371b65c24..2314080d70862847d0566cf430f893b6dadb14b0 100644 (file)
@@ -3,7 +3,7 @@ C      (ANSI X3.9-1978 Section 13.5.3.2)
 C
 C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
 C
-C { dg-do run {xfail *-*-*} } gfortran PR 16436
+C { dg-do run }
       integer i,j
       real a,b,c,d,e
       character*32 in
index 0ccd4cca190ceb063802d6245af3c328c06b7958..8a8bb33e1ef7b9743738dac29cf034f839e9cee1 100644 (file)
@@ -1,3 +1,12 @@
+2005-06-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/16436
+       * io/transfer.c (read_sf): Correct updating of bytes_left field.
+       (formatted_transfer): Correct updating of bytes_left field and
+       reformatting code (comments and whitespace).
+       * io/unix.c (move_pos_offset): "active" field should not be
+       changed here. Whitespace corrections.
+
 2005-06-15  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR libfortran/21950
index cb1df886fb64c4681826d4020d3528cca785d655..3bfa07a2c460b22087099f7dad1a6fe02b4eb741 100644 (file)
@@ -160,7 +160,6 @@ read_sf (int *length)
       return base;
     }
 
-  current_unit->bytes_left = options.default_recl;
   readlen = 1;
   n = 0;
 
@@ -214,6 +213,7 @@ read_sf (int *length)
       sf_seen_eor = 0;
     }
   while (n < *length);
+  current_unit->bytes_left -= *length;
 
   if (ioparm.size != NULL)
     *ioparm.size += *length;
@@ -675,22 +675,19 @@ formatted_transfer (bt type, void *p, int len)
 
         case FMT_TL:
         case FMT_T:
-           if (f->format==FMT_TL)
-             {
-                pos = f->u.n ;
-                pos= current_unit->recl - current_unit->bytes_left - pos;
-             }
-           else // FMT==T
+           if (f->format == FMT_TL)
+            pos = current_unit->recl - current_unit->bytes_left - f->u.n;
+           else /* FMT_T */
              {
-                consume_data_flag = 0 ;
-                pos = f->u.n - 1; 
+               consume_data_flag = 0 ;
+               pos = f->u.n - 1; 
              }
 
            if (pos < 0 || pos >= current_unit->recl )
-           {
-             generate_error (ERROR_EOR, "T Or TL edit position error");
-             break ;
-            }
+             {
+               generate_error (ERROR_EOR, "T Or TL edit position error");
+               break ;
+             }
             m = pos - (current_unit->recl - current_unit->bytes_left);
 
             if (m == 0)
@@ -707,6 +704,7 @@ formatted_transfer (bt type, void *p, int len)
             if (m < 0)
              {
                move_pos_offset (current_unit->s,m);
+              current_unit->bytes_left -= m;
              }
 
          break;
index 48ff84e3e16775ab8ad72047c01e29be7a2182f4..68bf83081a8e1fda34319d232d1f9453a56c09b5 100644 (file)
@@ -153,26 +153,22 @@ move_pos_offset (stream* st, int pos_off)
   unix_stream * str = (unix_stream*)st;
   if (pos_off < 0)
     {
-      str->active  += pos_off;
-      if (str->active < 0)
-         str->active = 0;
+      str->logical_offset += pos_off;
 
-      str->logical_offset  += pos_off;
-
-      if (str->dirty_offset+str->ndirty > str->logical_offset)
+      if (str->dirty_offset + str->ndirty > str->logical_offset)
         {
-          if (str->ndirty +  pos_off > 0)
-            str->ndirty += pos_off ;
+          if (str->ndirty + pos_off > 0)
+            str->ndirty += pos_off;
           else
             {
               str->dirty_offset +=  pos_off + pos_off;
-              str->ndirty = 0 ;
+              str->ndirty = 0;
             }
         }
 
-    return pos_off ;
+    return pos_off;
   }
-  return 0 ;
+  return 0;
 }