From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106051 invoked by alias); 7 Apr 2015 15:06:33 -0000 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 Received: (qmail 106032 invoked by uid 89); 7 Apr 2015 15:06:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 07 Apr 2015 15:06:20 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E8A3032B445; Tue, 7 Apr 2015 15:06:18 +0000 (UTC) Received: from localhost (ovpn-116-96.ams2.redhat.com [10.36.116.96]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t37F6HHG028570; Tue, 7 Apr 2015 11:06:18 -0400 Date: Tue, 07 Apr 2015 15:06:00 -0000 From: Jonathan Wakely To: Hans-Peter Nilsson Cc: Richard Henderson , libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [libstdc++/65033] Give alignment info to libatomic Message-ID: <20150407150617.GH9755@redhat.com> References: <54DD19B7.6060401@redhat.com> <20150403141333.GY9755@redhat.com> <20150407094458.GA9755@redhat.com> <20150407131252.GB9755@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-04/txt/msg00258.txt.bz2 On 07/04/15 10:51 -0400, Hans-Peter Nilsson wrote: >I was more thinking of something like: > >#include >#include >using std::cout; >using std::endl; > >struct SoSo { > double d; > int x alignas(sizeof(int)); >}; > >SoSo s __attribute__((__aligned__(16))); > >int main(void) >{ > cout << "alignof(s): " << alignof(s) << endl; > cout << "alignof(s.d): " << alignof(s.d) << endl; > cout << "alignof(s.x): " << alignof(s.x) << endl; >} > >in which I fear s.x would get an alignof the same as the s.d or >s, now or after a while, i.e. higher than specified. > >(I get for cris-elf at revision 221891: >alignof(s): 16 >alignof(s.d): 1 >alignof(s.x): 4 >which is kind-of-expected except I thought s.d would get the s >alignment so that just leaves it open whether that could >possibly change.) The docs are clear that alignof(s.x) is not related to its position in struct SoSo: https://gcc.gnu.org/onlinedocs/gcc/Alignment.html I'm not going to worry about that behaviour changing.