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/57522] [F03] ASSOCIATE construct creates array descriptor with incorrect stride for derived type array component


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.


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