This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch c++]: PR c++/44294 abi/bitfield12.C regression
On Thu, May 27, 2010 at 10:24 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, May 27, 2010 at 8:02 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> Hello,
>>
>> the issue is here that in class.c function layout_class_type an
>> underflow of itk could be produced, when first enumerator is already
>> end-criteria.
>>
>> ChangeLog
>>
>> 2010-05-27 ?Kai Tietz
>>
>> ? ? ? ?PR c++/44294
>> ? ? ? ?* class.c (layout_class_type): Prevent underflow for itk.
>>
>> Tested for x86_64-pc-linux-gnu and x86_64-w64-mingw32. Ok for apply?
>>
>
> I am not sure if it is correct.. We now use __int128 for the type of bitfield.
>
This patch works for me. I think we need to exam all usage of itk_none to
see if it should be updated.
--
H.J.
---
Index: class.c
===================================================================
--- class.c (revision 159879)
+++ class.c (working copy)
@@ -4973,8 +4973,10 @@ layout_class_type (tree t, tree *virtual
/* We must allocate the bits as if suitably aligned for the
longest integer type that fits in this many bits. type
of the field. Then, we are supposed to use the left over
- bits as additional padding. */
- for (itk = itk_char; itk != itk_none; ++itk)
+ bits as additional padding.
+
+ FIXME: Is __int128 allowed for bitfield? */
+ for (itk = itk_char; itk != itk_int128; ++itk)
if (INT_CST_LT (DECL_SIZE (field),
TYPE_SIZE (integer_types[itk])))
break;