[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 --- Comment #6 from Dominique d'Humieres dominiq at lps dot ens.fr --- Any reason why tho PR is not closed as fixed?
[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 --- Comment #7 from Dominique d'Humieres dominiq at lps dot ens.fr --- *** Bug 58339 has been marked as a duplicate of this bug. ***
[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 Paul Thomas pault at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #8 from Paul Thomas pault at gcc dot gnu.org --- No reason whatsoever, except that I forgot! Thanks for the report. Paul
[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 --- Comment #5 from Paul Thomas pault at gcc dot gnu.org --- Author: pault Date: Sun Feb 9 20:50:21 2014 New Revision: 207646 URL: http://gcc.gnu.org/viewcvs?rev=207646root=gccview=rev Log: 2014-02-09 Paul Thomas pa...@gcc.gnu.org PR fortran/57522 * resolve.c (resolve_assoc_var): Set the subref_array_pointer attribute for the 'associate-name' if necessary. * trans-stmt.c (trans_associate_var): If the 'associate-name' is a subref_array_pointer, assign the element size of the associate variable to 'span'. 2014-02-09 Paul Thomas pa...@gcc.gnu.org PR fortran/57522 * gfortran.dg/associated_target_5.f03 : New test Added: trunk/gcc/testsuite/gfortran.dg/associated_target_5.f03 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/fortran/trans-stmt.c trunk/gcc/testsuite/ChangeLog
[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 --- Comment #4 from Paul Thomas pault at gcc dot gnu.org --- (In reply to Tobias Burnus from comment #3) print *, a I have not yet completely understood why, but the call gfc_conv_expr_descriptor yields a unit stride. We have a choice here: (i) We use the 'span' variable that is used for pointers to some useful effect. Ideally, this should be accompanied by passing of the 'span' variable to pointer formal arguments in function calls. That way, even if kludgy we would have a full implementation of the F95(!) standard (see for example PR40737 + others that I cannot find right now); or (ii) That we attach 'span' to pointer array descriptors; or (iii) We recognised one the the ASSOCIATE todos, which is the make a temporary when needed and write the selector result to that temporary. This is also required for SELECT TYPE. Examples are where the selector is a function call. (ii)Would cause a diversion from the array descriptor reform but are we really in a position to implement that? Both Tobias and I are taken by daytime work for the foreseeable future. It certainly would be a clean way to proceed. (iii) Must be done sometime... soon. It could be used to fix this case using write-in/write-out but would not fix the F95 problems. I am prepared to make this my next gfortran job. I would suggest (i) or (ii) followed by (iii). Cheers Paul
[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.
[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 Dominique d'Humieres dominiq at lps dot ens.fr changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2013-07-02 Ever confirmed|0 |1 --- Comment #2 from Dominique d'Humieres dominiq at lps dot ens.fr --- Still present at revision 200581.
[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 --- Comment #1 from Alan Briolat alan.briolat at gmail dot com --- Created attachment 30255 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=30255action=edit Working equivalent code based on pointers For comparison, this attached code uses pointers to achieve the same thing and gets the correct result. What's so different between the array descriptors used for pointers and the array descriptors use for ASSOCIATE?