This is the mail archive of the gcc-bugs@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]

[Bug ada/19900] [4.0 Regression] ACATS c391002 c432002 ICE categorize_ctor_elements_1


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-16 03:21 -------
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 */

The code in the Ada front-end to use unions instead of structs was introduced with:
2005-02-09  Eric Botcazou  <ebotcazou@adacore.com>
            Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

        Fix for c330001 - PR ada/19386

So this is a new bug in that the ada front-end is abusing UNION in this case

Here is the link to the patch: <http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00424.html>.

In fact the quote "GCC assumes that a RECORD_TYPE does not have any overlapping fields. " is true and 
so is UNION_TYPE assumes that only one field is initialized as shown above.

I would assume this requires a large number of fixes in the Ada front-end.

(There was a C++ bug which was caused by the overlapping fields also which was fixed correctly).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kenner at vlsi1 dot ultra
                   |                            |dot nyu dot edu


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


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