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/28160] Bogus "size of array 'foo' is too large" error with -mms-bitfields



------- 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


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