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 20:56:57 -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 #7 from burnus at gcc dot gnu dot org 2007-08-02 20:56 -------
CONJ_EXPR< a.data[0*1+(-2)]>
The offset = -2 is generated in gfc_conv_expr_descriptor:
offset = gfc_index_zero_node;
for (n = 0; n < ndim; n++) // ndim = 2
start = info->start[dim]; // start = 0;
tmp = gfc_conv_array_lbound (desc, n); // "tmp = 1"
// "tmp = 0 - 1 = -1"
tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (tmp), start, tmp);
// tmp = tmp * 1 = -1
tmp = fold_build2 (MULT_EXPR, TREE_TYPE (tmp), tmp, stride);
// offset = offset + tmp = offset + (-1)
offset = fold_build2 (PLUS_EXPR, TREE_TYPE (tmp), offset, tmp);
Still, I don't quite understand how it is supposed to work.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32962