This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/28160] Bogus "size of array 'foo' is too large" error with -mms-bitfields
- From: "seongbae dot park at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jun 2006 21:08:23 -0000
- Subject: [Bug middle-end/28160] Bogus "size of array 'foo' is too large" error with -mms-bitfields
- References: <bug-28160-5208@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from seongbae dot park at gmail dot com 2006-06-26 21:08 -------
The immediate cause of the problem is in stor-layout.c:place_field():
1118 if (DECL_SIZE (field) != NULL
1119 && host_integerp (TYPE_SIZE (TREE_TYPE (field)), 0)
1120 && host_integerp (DECL_SIZE (field), 0))
1121 rli->remaining_in_alignment
1122 = tree_low_cst (TYPE_SIZE (TREE_TYPE(field)), 1)
1123 - tree_low_cst (DECL_SIZE (field), 1);
For the field "d",
remiaining_in_alignment becomes negative after line 1121-1123
- because the DECL_SIZE is larger than TYPE_SIZE for "d".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28160