This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/58043] [OOP] Incorrect behaviour of polymorphic array
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Aug 2013 14:49:22 +0000
- Subject: [Bug fortran/58043] [OOP] Incorrect behaviour of polymorphic array
- Auto-submitted: auto-generated
- References: <bug-58043-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58043
--- Comment #3 from janus at gcc dot gnu.org ---
The WRITE of the second element in main is translated into:
_gfortran_transfer_real_write (&dt_parm.7, (real(kind=4) *) &((struct adof_t *)
dofs._data.data + (sizetype) ((dofs._data.offset + 1) * (integer(kind=8))
dofs._vptr->_size))->grd + (sizetype) dofs._vptr->_size, 4);
The problem is apparently that "grd" does not receive the correct indexing
here, but instead "dofs._vptr->_size" is added to the address, which however is
the element size of the "dofs" array and not of "grd"!