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


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