This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
PR33749 - Wrong evaluation of expressions in lhs of assignment statements
- From: "Paul Richard Thomas" <paul dot richard dot thomas at gmail dot com>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, "Paul Brook" <paul at codesourcery dot com>
- Date: Fri, 12 Oct 2007 21:21:13 +0200
- Subject: PR33749 - Wrong evaluation of expressions in lhs of assignment statements
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=bKiqpb4YLhBk5Q3QMnGETU78nxoWQC0iipQreuyaHB8=; b=O3H7Vko7mYkHumwtT+X3SDRCfeJfYBsbQU4UB2JH24y1X1wvn1BDZb8ZyNZQk5VdyizZ0RioI/RFOE/KCAArSO7IGo/bvjODuhKkhvYzWO5Dfb8/+uQg5Mcb3Uy7EYh5Ulb8Dr5/QFsJ7qQQ9NICj4xmcR3jKsIl4IqqJFMOaX8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=DTy7FrE3XhDc//gcaubsL7HdsQHmJycspHEVhc/5yLk6hhksCLV5WSQsRBSaVSzlg8duCBXsxLSpACWmKLBv2jP8JRCbX0nFjgM43UqGeAMpJN3VBrX48W4iy+ZzLm5br0j/rT1hGP97CtAI0XTDWJmx26hojp/c/6UN6+YyPlk=
This is by way of an appeal...
This bug only appears in -m32 or, rather, it disappears in -m64. What
is odd is that an entire block of code produced by the scalarizer
appears and disappears according to the mode. What is even odder is
that I cannot even figure out how the correct code is ever produced.
This:
integer(4) :: p(4) = (/2,4,1,3/)
p(p) = (/(i, i = 1, 4)/)
print *, p
end
with -m64 produces:
static int4 p[4] = {2, 4, 1, 3};
int4 i;
static int4 options.0[7] = {68, 127, 0, 0, 0, 1, 0};
_gfortran_set_options (7, (void *) &options.0);
{
int8 A.3[4];
struct array1_int8 atmp.2;
static int4 A.1[4] = {1, 2, 3, 4};
atmp.2.dtype = 521;
atmp.2.dim[0].stride = 1;
atmp.2.dim[0].lbound = 0;
atmp.2.dim[0].ubound = 3;
atmp.2.data = (void *) &A.3;
atmp.2.offset = 0;
{
int8 S.4;
S.4 = 0;
while (1)
{
if (S.4 > 3) goto L.1;
(*(int8[0:] *) atmp.2.data)[S.4] = (int8) p[S.4];
S.4 = S.4 + 1;
}
L.1:;
}
{
int8 S.5;
S.5 = 0;
while (1)
{
if (S.5 > 3) goto L.2;
{
int8 D.875;
D.875 = (*(int8[0:] *) atmp.2.data)[S.5];
p[D.875 + -1] = A.1[S.5];
}
S.5 = S.5 + 1;
}
L.2:;
}
}
........+ the io.....
but the block that produces D.875 goes away in -m32 mode, so that the
assignment becomes, incorrectly:
D.513 = (*(int4[0:] *) parm.2.data)[parm.2.dim[0].stride *
NON_LVALUE_EXPR <S.3>];
p[D.513 + -1] = A.1[S.3];
an anybody cast any light on this? It's driving me bonkers...
Paul
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy