This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [rfc] rewrite of local equivalences
- From: canqun at nudt dot edu dot cn
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Thu, 27 Nov 2003 22:38:51 +0800 (HKT)
- Subject: Re: [rfc] rewrite of local equivalences
- References: <20031127042950.GA581@twiddle.net>
- Reply-to: canqun at nudt dot edu dot cn
Richard Henderson <rth@twiddle.net>:
> While staring at output for the nearest intrinsic
test case, I
> noticed how ugly the generated code for equivalences
is. And
> that the existing implementation can in fact fail to
provide
> sufficient alignment for the types involved.
>
> My replacement implementation uses a UNION_TYPE, with
the caveat
> that offsets of the fields are not necessarily zero.
(Jason, do
> you think this will cause problems? It doesn't seem
to...) We
> then treat the members of the equivalence more or
less like
> members of a C++ anonymous union.
>
> I'm somewhat concerned that there are almost no test
cases for
> equivalence in the test suite, so I have no idea what
happens
> here for corner cases.
>
> This is not a complete patch. I have Hordes of other
things in
> my tree at present, and I didn't want to confuse the
issue, or
> figure out what bits this actually relies on. It may
be only
> exporting update_alignment_for_field from stor-
layout.c.
>
> Thoughts?
>
I also rewrote the implementation of COMMON blocks by
taking the same way. It can pass my test programs. But,
we still need to find a way to deal with CHARACTER
inside COMMON block. Is it worth to do?
As the code for constructing the 'UNION_TYPE' in 'trans-
equivalence.c' is very similar to which in 'trans-
common.c', also, 'trans-common.c' needs handle global
EQUIVALENCE. Is it necessary to combine the two files?
Canqun Yang