Equivalences *look* broken
François-Xavier Coudert
fxcoudert@gmail.com
Fri Oct 14 14:04:00 GMT 2005
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
More information about the Fortran
mailing list