This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SEGV in do_simple_structure_copy
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: dberlin at dberlin dot org
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 7 Oct 05 08:26:07 EDT
- Subject: Re: SEGV in do_simple_structure_copy
Personally, I would have not had a DECL_SIZE, i would have made
TYPE_SIZE express the type size properly (IE not always a multiple).
What is the incredibly good reason we have them both, other than to save
memory in the number of bitfield types we create?
Because we need to have a way to express the semantic concept of having
an object of the type that has a slightly different representation than
the type. We could do this by making a new type for that object (Ada
does this in some cases) and having conversions all over the place, but
it's a mess.
Bitfields are one example of this and so is the programmer specifying that
some object have a larger alignment and/or size than its type would otherwise
require.
One hole in our typing system, by the way, is that there's no DECL_SIZE
equivalent for the component type in an array so if you want to have an
array of a type where the component is to be viewed as wider than the
size of the type, you *do* have to make a new type to do that,