This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32962] b = conjg(transpose(a)) is erroneous if b is an allocatable array
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Aug 2007 16:32:51 -0000
- Subject: [Bug fortran/32962] b = conjg(transpose(a)) is erroneous if b is an allocatable array
- References: <bug-32962-3515@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from burnus at gcc dot gnu dot org 2007-08-02 16:32 -------
For my testcase (with parameter) I find the following in the original dump:
(*D.1371)[(S.4 + D.1380) * D.1384 + D.1387] = CONJ_EXPR <(*(complex4[0:] *)
parm.1.data)[S.4 * D.1383 + D.1386]>;
Rewritten this is:
b.data[(0+1)*1+(-1)] = CONJ_EXPR< a.data[0*1+(-2)]>
or shorter:
b.data[0] = a.data[-2]
For A:
S.4 * D.1383 + D.1386
= 0 * 1 + (-2)
= -2
where
S.4 = 0 loop variable
D.1383 = 1 (a.dim[0].stride)
D.1386 = a.offset + a.dim[1].stride * S.4
= -2 + 1 * 0
and for B:
(S.4 + D.1380) * D.1384 + D.1387
= (0 + 1 ) * 1 + (-1)
= 0
where
S.4 = 0 loop variable
D.1380 = b.lbound = 1
D.1384 = b.dim[0].stride = 1
D.1387 = a.offset + a.dim[1].stride * S.3
= (-2) + 1 * 0
S.3 = 0 other loop variable
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32962