[Patch, fortran] PR 60392 wrong descriptor when passing a transposed array to a contiguous assumed shape dummy.

Mikael Morin mikael.morin@sfr.fr
Sun Mar 9 16:26:00 GMT 2014


Hello,

here is a fix for a wrong code issue, where we pass a descriptor with
broken bounds when the actual argument is a transposed array and the
dummy an assumed shape dummy.
The bug comes from the interaction of the transpose optimization,
which creates a descriptor with transposed bounds without copying the
data, and the contiguous optimization, which reuses the descriptor for
passing as argument after the call to internal_pack.
The attached patch makes a copy of the descriptor with the correct
bounds when a transposed scalarization is detected.

Regression-tested on x86_64-unknown-linux-gnu.
This is not a regression as far as I know, but quite a severe
wrong-code, albeit limited to the corner case of transpose and
assumed shape and contiguous.  OK for trunk/4.8/4.7 anyway ?


Mikael

PS: To not reproduce the same mistake as in the PR regarding the memory
representation of matrices, I have filled the matrices one element at a
time in the testcase.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr60392_v1.diff
Type: text/x-patch
Size: 2314 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140309/29e7440b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transpose_4.f90
Type: text/x-fortran
Size: 1647 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140309/29e7440b/attachment-0001.bin>


More information about the Gcc-patches mailing list