This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [google]: initialize language field for clone function struct
On Tue, 3 May 2011, Nathan Froyd wrote:
> On Tue, May 03, 2011 at 07:06:58PM +0000, Joseph S. Myers wrote:
> > In my view we should require front ends to take responsibility for
> > variable-size types, and get rid of this language-independent function
> > (copying such parts as are needed into the front ends that need them). C
> > for example uses its own version as the language-independent one isn't
> > right for C. Similarly, the pending_size code should be local to front
> > ends.
>
> The raft of changes/improvements enabled by this change would be most
> welcome. *_SIZE becoming double_ints or HOST_WIDE_INT instead of trees
> is the first thing that comes to mind; perhaps there are others.
I don't see how you can do that; you'll still have variable-sized types
and objects, it would just be entirely the front end's responsibility to
ensure that the size expression is evaluated exactly once (whenever
required by the language). At most, the size would either be a constant
or an internal DECL created by the front end if you move that to the front
end instead of using SAVE_EXPR.
However, I think the fields storing type and decl sizes (and alignment) in
*bits* are suspect. Values in bits are needed when dealing with bit-field
layout, but I think types should otherwise be defined to be made up of
whole bytes (bytes of BITS_PER_UNIT bits, at this level) with code dealing
with bit-fields looking at TYPE_PRECISION as needed.
--
Joseph S. Myers
joseph@codesourcery.com