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 20:46:07 -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 #1 from seongbae dot park at gmail dot com 2006-06-26 20:46 -------
I belive this is a bug in stor-layout.c:place_field() around line 10503
bitpos is calculated as bit_offset of rli->prev_field + type size.
However, the prev_field is not really the immediately previous field but the
first field of the consecutive same-sized fields.
Hence, in this case:
struct S
{
long long d:23;
int e:32;
int f:32;
} a;
rli->prev_field is "d" when "field" is f.
The correct fix should calculate the bitpos as
rli->bitpos + type size.
--
seongbae dot park at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |seongbae dot park at gmail
| |dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28160