This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Equivalences *look* broken


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]