From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21045 invoked by alias); 1 Sep 2011 15:01:33 -0000 Received: (qmail 21036 invoked by uid 22791); 1 Sep 2011 15:01:31 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Sep 2011 15:01:14 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p81F1DoO030629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Sep 2011 11:01:14 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p81F1DnF030120; Thu, 1 Sep 2011 11:01:13 -0400 Received: from [0.0.0.0] (ovpn-113-78.phx2.redhat.com [10.3.113.78]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p81F1CbR023872; Thu, 1 Sep 2011 11:01:12 -0400 Message-ID: <4E5F9E37.6010608@redhat.com> Date: Thu, 01 Sep 2011 15:01:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20110817 Thunderbird/6.0 MIME-Version: 1.0 To: Aldy Hernandez CC: Richard Guenther , gcc-patches Subject: Re: [C++0x] contiguous bitfields race implementation References: <4DC8155A.3040401@redhat.com> <4DDE9DED.6040801@redhat.com> <4DDFF90E.7070408@redhat.com> <4E2420E6.8090809@redhat.com> <4E29C502.8020100@redhat.com> <4E2DA2BA.1010003@redhat.com> <4E2E0264.30909@redhat.com> <4E2EED10.5030901@redhat.com> <4E2EF1E7.4020606@redhat.com> <4E2EFA1C.10803@redhat.com> <4E2EFB89.7060503@redhat.com> <4E3C2773.30502@redhat.com> <4E417EE4.9040501@redhat.com> <4E495D11.5000306@redhat.com> <4E57EBDC.9090900@redhat.com> <4E5F9C3E.1050405@redhat.com> In-Reply-To: <4E5F9C3E.1050405@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00071.txt.bz2 On 09/01/2011 10:52 AM, Aldy Hernandez wrote: > To answer your question, I believe we can't touch past the last field > (into the padding) if the subsequent record will be packed into the > first's padding. Right. > struct A { > int a : 17; > }; > struct B : public A { > char c; > }; > > So here, if gets packed into the tail-padding of A, we can't touch > the padding of A when storing into . But that doesn't apply to this testcase because A is a POD class, so we don't mess with its tail padding. > Is there a way of distinguishing this particular variant (possible > tail-packing), or will we have to disallow storing into the record tail > padding altogether? That would seriously suck. Basically you can only touch the size of the CLASSTYPE_AS_BASE variant. For many classes this will be the same as the size of the class itself. Jason