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


------- Additional Comments From steven at gcc dot gnu dot org  2005-01-20 09:04 -------
This is odd. 
 
For a struct { char a[8]; } count_type_elements returns 8. 
For a union { char a[8]; } count_type_elements returns 1. 
 
This confuses the following code in gimplify_init_constructor: 
 
        /* ??? This bit ought not be needed.  For any element not present 
           in the initializer, we should simply set them to zero.  Except 
           we'd need to *find* the elements that are not present, and that 
           requires trickery to avoid quadratic compile-time behavior in 
           large cases or excessive memory use in small cases.  */ 
        else if (num_ctor_elements < num_type_elements) 
          cleared = true; 
 
num_ctor_elements == 1 and num_type_elements == 1, so we don't clear. 
 

-- 


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]