This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35339] Improve translation of implied do loop in transfer
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2008 07:59:59 -0000
- Subject: [Bug fortran/35339] Improve translation of implied do loop in transfer
- References: <bug-35339-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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