public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35339]  New: Improve translation of implied do loop in transfer
@ 2008-02-24  1:41 jvdelisle at gcc dot gnu dot org
  2008-02-25 10:01 ` [Bug fortran/35339] " fxcoudert at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-24  1:41 UTC (permalink / raw)
  To: gcc-bugs

Currently we create a looping structure which is executed to traverse an array
and transfer it one element at a time.  This works, but is not too efficient. 
We could improve this by converting the implied do loops into the appropriate
array descriptor and call transfer_array.

The two cases are:

real, dimension(10) :: a
write(10,'(10f8.3)') a
write(10,'(10f8.3)') (a(i), i=1,10)

Gives:

    _gfortran_st_write (&dt_parm.3);
    {
      struct array1_real(kind=4) parm.4;

      parm.4.dtype = 281;
      parm.4.dim[0].lbound = 1;
      parm.4.dim[0].ubound = 10;
      parm.4.dim[0].stride = 1;
      parm.4.data = (void *) &a[0];
      parm.4.offset = -1;
      _gfortran_transfer_array (&dt_parm.3, &parm.4, 4, 0);
    }
    _gfortran_st_write_done (&dt_parm.3);

and

    _gfortran_st_write (&dt_parm.3);
    i = 1;
    if (i <= 10)
      {
        while (1)
          {
            {
              logical(kind=4) D.958;

              _gfortran_transfer_real (&dt_parm.3, &a[(integer(kind=8)) i +
-1], 4);
              L.2:;
              D.958 = i == 10;
              i = i + 1;
              if (D.958) goto L.3;
            }
          }
      }
    L.3:;
    _gfortran_st_write_done (&dt_parm.3);

The former is needed to simplify asynchronous I/O where we need to be able to
convey to the I/O thread the task to be done and not the actual code to do the
looping.

Putting it another way, if the implied loop has 10000 count.  We need to pass
that count to the I/O routines, so they can take it and run with it.


-- 
           Summary: Improve translation of implied do loop in transfer
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jvdelisle at gcc dot gnu dot org
OtherBugsDependingO 25829
             nThis:


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


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-35339-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2013-08-31 18:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-24  1:41 [Bug fortran/35339] New: Improve translation of implied do loop in transfer jvdelisle at gcc dot gnu dot org
2008-02-25 10:01 ` [Bug fortran/35339] " fxcoudert at gcc dot gnu dot org
2008-03-01 16:23 ` jvdelisle at gcc dot gnu dot org
2008-03-02  8:00 ` pault at gcc dot gnu dot org
2008-03-13  5:20 ` jvdelisle at gcc dot gnu dot org
2009-10-31  1:42 ` jvdelisle at gcc dot gnu dot org
     [not found] <bug-35339-4@http.gcc.gnu.org/bugzilla/>
2013-08-31 18:27 ` tkoenig at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).