This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Equivalences *look* broken
- From: François-Xavier Coudert <fxcoudert at gmail dot com>
- To: GNU GFortran <fortran at gcc dot gnu dot org>, jakub at redhat dot com
- Date: Fri, 14 Oct 2005 16:01:50 +0200
- Subject: Equivalences *look* broken
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Dl1177UPVq+6IkPb3xPkYFG1iG0ebxjeYGDhGV9SRcfEn02BzVCbkzWZ343tQVGOFzBarkI2g8lgVuC0O+EkfYOtLKmzAMkgVc7k0JJJGrMNnC9Vu2b5hk+3o+FmbrsHIwM4mjHpRVW/fByy2RBXCG8XyqY25eWLky2a5okXuPA=
Hi all,
My mind is puzzled by Jakub's patch:
2005-10-12 Jakub Jelinek <jakub@redhat.com>
* trans-common.c (build_field): Fix comment typo.
(create_common): Set backend_decl of COMMON or EQUIVALENCEd
variables to a VAR_DECL with the COMPONENT_REF in
DECL_HAS_VALUE_EXPR rather than COMPONENT_REF directly.
* f95-lang.c (gfc_expand_function): Emit debug info for
EQUIVALENCEd variables if the equiv union is going to be output.
It makes the tree dumps look like equivalences are broken (but I think
they're not):
$ cat a.f90
PROGRAM TEST_FPU
REAL :: pool(10,10), pool3(100)
EQUIVALENCE (pool,pool3)
pool(1,1) = 0.0
END PROGRAM TEST_FPU
$ ./irun-20051012/bin/gfortran -fdump-tree-original a.f90 && cat
a.f90.t02.original
MAIN__ ()
{
union
{
real4 pool3[100];
real4 pool[100];
} equiv.0;
equiv.0.pool[0] = 0.0;
}
$ ./irun-20051013/bin/gfortran -fdump-tree-original a.f90 && cat
a.f90.t02.original
MAIN__ ()
{
union
{
real4 pool3[100];
real4 pool[100];
} equiv.0;
real4 pool3[100];
real4 pool[100];
pool[0] = 0.0;
}
The later looks wrong, but it seems that the object code produced is
correct. Can this considered as a bug, or am I just growing crazy?
FX