This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: Patch: stab info for const fields


On Thu, Oct 31, 2002 at 12:51:38PM -0800, Mark Mitchell wrote:
> >In general I think we encode way too much information in DECLs which
> >is redundant with their TYPEs.  Off the top of my head: I don't see
> >any legitimate reason why the size, size_unit, arguments, attributes,
> >and possibly pointer_alias_set fields, and a bunch of the flags should
> >ever differ from the corresponding field in TREE_TYPE (decl).
> 
> I very much agree with this, in spirit.  There may be things in some
> languages that somehow make these things different, but I'm not sure what.
> You carefully left out alignment; the GNU attribute extensions do allow
> you to align variables differently from their types -- though I have
> argued in the past that this is an abuse of the notion of type.

I didn't intentionally leave it out; I missed it because it's buiried
in a union.

It is valuable to be able to say "_this_ _particular_ integer needs a
specific alignment independent of what alignment the ABI gives the
type" but I don't see any real reason why we couldn't create a special
type structure for that.  We already have to have a notion of "these
two types are not the same but are still compatible" in the language-
independent type algebra.

> There are other attributes (like "unused") that do make sense for a
> variable independently of its type, though.

Yah.

zw


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