This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/19515] [4.0 Regression] Violation of C99 6.7.8 §21
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jan 2005 09:04:26 -0000
- Subject: [Bug middle-end/19515] [4.0 Regression] Violation of C99 6.7.8 §21
- References: <20050118221058.19515.ebotcazou@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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