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 middle-end/19515] [4.0 Regression] Violation of C99 6.7.8 §21 for unions


------- Additional Comments From rth at gcc dot gnu dot org  2005-01-20 11:28 -------
(In reply to comment #7)
> So we cannot use count_type_elements in gimplify_init_constructor. 

Well, not for unions anyway.

> I think we should somehow compute the size of the CONSTRUCTOR and compare 
> it with int_size_in_bytes (TREE_TYPE (object))...? 

For unions, that may be what we have to do.  With any luck, the element
being initialized will be the largest element of the union, which would
mean we wouldn't have to emit the clear.

For structures, this would mean that any structure with holes would get
cleared.  Which would clearly pessimize a very common case.


-- 


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


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