This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/35339] Improve translation of implied do loop in transfer



------- Comment #3 from pault at gcc dot gnu dot org  2008-03-02 07:59 -------

> In the meantime, I am thinking through a different approach for aio that avoids
> the issue here.
> 

Yes it would - use gfc_conv_expr_descriptor to convert the expression and pass
the resulting array descriptor.  For the cases that you are concerned with,
this would be a temporary.  However, gfortran_transfer array would be used and
the io itself taken out of the loop. Obviously, this would only work for a
WRITE operation and gfc_conv_subref_array_arg would have to be used for a READ
- as in the existing code in gfc_trans_transfer.

In fact, I believe that the exsting code in gfc_trans_transfer would be able to
handle iterator expressions, were they passed to it.  However, the frontend
does this scalarization; see io.c(match_io_element):2396 onwards. This builds
up a DO loop and a call to EXEC_TRANSFER for each element.  Where there is only
one element, you will get what you want by turning the iterator expression into
an EXPR_ARRAY and writing the gfc_code to pass that to EXEC_TRANSFER.  I think
that it should be a very straightforward job.

Best of luck!

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-02 07:59:59
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]