------- Additional Comments From kenner at vlsi1 dot ultra dot nyu dot edu  
2005-02-16 04:08 -------
Subject: Re:   [4.0 Regression] ACATS c391002 c432002 ICE 
categorize_ctor_elements_1

Thanks for looking into this. I hadn't gotten a chance yet, but was very
close to getting to it.

    Just for the record UNION TYPE is defined in tree.def as something
    different than what the Ada front- end is using it for, From tree.def:
    /* Union in C.  Like a struct, except that the offsets of the fields
       will all be zero.  */
    /* See the comment above, before ENUMERAL_TYPE, for how
       forward references to union tags are handled in C.  */
    DEFTREECODE (UNION_TYPE, "union_type", tcc_type, 0)     /* C union type */

Ugh!  This is a mess.

I didn't notice the assumption about UNION_TYPE, concentrating just
on the non-overlapping assumption.

I'm not sure anybody actually relies on the assumption that all field offsets
are zero, but that would need to be checked.  The initializer issue is
more serious, of course.

Record subtypes in general can have overlapping fields (consider variants),
but you can't validly reference two overlapping fields at the same time.
Records with _Parent fields are an exception, but they can't be easily
transformed into being non-overlapping (via nesting) as I understand it
without a lot of surgery to the Ada part of the front end.

This will require considerable investigation.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19900

Reply via email to