This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57522] [F03] ASSOCIATE construct creates array descriptor with incorrect stride for derived type array component
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 01 Dec 2013 21:44:15 +0000
- Subject: [Bug fortran/57522] [F03] ASSOCIATE construct creates array descriptor with incorrect stride for derived type array component
- Auto-submitted: auto-generated
- References: <bug-57522-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57522
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org,
| |pault at gcc dot gnu.org
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
> print *, a
produces (internal representation, -fdump-tree-original):
a.dtype = 265;
a.dim[0].lbound = 1;
a.dim[0].ubound = 4;
a.dim[0].stride = 1;
a.data = (void * restrict) &t[0].a;
_gfortran_transfer_array_write (&dt_parm.6, &a, 4, 0);
obviously, stride = 1 is wrong.
In trans_associate_var, one has:
if (sym->assoc->variable)
{
se.direct_byref = 1;
se.expr = desc;
}
gfc_conv_expr_descriptor (&se, e);
where desc == backend decl of "a" (name in the associate statement) and e ==
gfc_expr of the selector (i.e. t%a).
I have not yet completely understood why, but the call gfc_conv_expr_descriptor
yields a unit stride.